SMPP using WSO2 - wso2

Hi Followed the blog mentioned in SMS Transport sender in wso2 ESB and configured axis2.xml for transportSender and transportReceiver. I am able to send a message from ESB to SMPP simulator but I am unable to receive message from SMPP simulator to ESB.
In the SMPP Simulator, I tried by adding bot 't'/'r' to enable transmitter/receiver and also tried by giving tr assuming that it is for tranceiver in users.txt but still I am unable to get a response in ESB.
Could you please help in implementing SMPP -> ESB scenario. Any link that describes this procedure also helpful for me. ( I am unable to find such)
I am editing this to make my scenario more clear
My simulator is opensmpp-sim. I added the user details in user.txt as
name=esb
password=esb
timeout=unlimited
bound=t,r
I executed the simulator with port 2775.
In ESB, axis2.xml I gave the following configurations
Transport Receiver
<transportReceiver name="sms" class="org.apache.axis2.transport.sms.SMSMessageReciever">
<parameter name="systemType">cp</parameter>
<parameter name="systemId">esb</parameter>
<parameter name="password">esb</parameter>
<parameter name="host">192.168.0.2</parameter>
<parameter name="port">2775</parameter>
<parameter name="phoneNumber">94777179968</parameter>
</transportReceiver>
Transport Sender
<transportSender name="sms" class="org.apache.axis2.transport.sms.SMSSender">
<parameter name="systemType">cp</parameter>
<parameter name="systemId">esb</parameter>
<parameter name="password">esb</parameter>
<parameter name="host">127.0.0.1</parameter>
<parameter name="port">2775</parameter>
</transportSender>
Note: 192.168.0.2 = 127.0.0.1 = localhost
Scenarios
1. Sending a message from ESME (ESB) to SMSC (Simulator)
Sequence
<sequence xmlns="http://ws.apache.org/ns/synapse" name="TEST_SMS">
<send>
<endpoint key="SMSC"/>
</send>
</sequence>
Endpoint
sms://94777179968
I exposed this sequence as a REST API. When I send a message, the message reached Simulator but there is no response in return.
2. Sending a message from SMSC (Simulator) to ESMC (ESB)
From simulator when I send message, it reaches ESB. In debug mode the message is printed in ESB log. But I am unable to handle it. How can I configure proxy service/ sequence to get that message. My goal is to get that message and initiate a process.
Thanks in advance.

Related

How can WSO2 pick up messages from ActiveMQ without calling any WSO2 api or proxy by client application?

How can WSO2 pick up messages from ActiveMQ without calling any WSO2 api or proxy by client application?
[Please note:- Source System will send messages through ActiveMQ and WSO2 will have to pick up those messages]
Can anybody provide any solution?? I am clueless...
you need to:
Configure wso2 esb to work with activemq...copy /lib
directory to < ESB_HOME>/repository/components/lib
Enable and configure JMSReceiver and JMSSender for Activemq in conf/axis2/axis2.xml. uncomment the configuration for activemq.
The wso2 esb proxy need jms transport active inside it configuration.
configure this parameters after target section inside proxy configuration:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="ForwardProxy" startOnLoad="true" statistics="disable" trace="disable" transports="jms1">
<target>
</target>
<parameter name="transport.jms.DestinationType">queue</parameter>
<parameter name="transport.jms.Destination">yourQueue</parameter>
<parameter name="transport.jms.ContentType">
<rules xmlns="">
<jmsProperty>contentType</jmsProperty>
<default>application/xml</default>
</rules>
</parameter>
<parametername="transport.jms.ConnectionFactory">
myQueueConnectionFactory
</parameter>
</proxy>
create yourQueue inside activeMQ.
put a message in yourQueue.

Can I use the rate limit header to implement rate limitation directly on WSO2 ESB message processor?

I am very new in WSO2 ESB and I have the following situation to deal with.
I have a Message Processor which extracts some XML messages from a queue and that send it to an external web service, something like this:
<?xml version="1.0" encoding="UTF-8"?>
<messageProcessor class="org.apache.synapse.message.processor.impl.forwarder.ScheduledMessageForwardingProcessor" messageStore="glisMessageStore" name="glisMessageProcessor" targetEndpoint="glisEndpoint" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="client.retry.interval">100</parameter>
<parameter name="max.delivery.attempts">4</parameter>
<parameter name="member.count">1</parameter>
<parameter name="message.processor.reply.sequence">glisResponseSequence</parameter>
<parameter name="max.delivery.drop">Disabled</parameter>
<parameter name="interval">10</parameter>
<parameter name="is.active">true</parameter>
</messageProcessor>
Where the glisResponseSequence.xml contains a pretty complex behavior ending with a callout mediator that send the message to my external web service.
It works fine but now I have also to deal with the rate limitation concept.
When the message processor call the glisResponseSequence.xml sequence it ends with a callout mediator that send the message to my external web service that return a response containing headers like:
X-Rate-Limit-Limit
X-Rate-Limit-Remaining
X-Rate-Limit-Reset
Can I use these headers to instruct the message processor to wait to call the glisResponseSequence.xml sequence or something like this (to avoid to send too much request to the external web service)

Can I log in a file the web service response called by a WSO2 message processor?

I am pretty new in WSO2 ESB and I have the following problem.
Into my ESB flow I have a Store mediator that put an XML document ino a WSO2 MB queue, this is the configuration of my message store:
<?xml version="1.0" encoding="UTF-8"?>
<messageStore class="org.apache.synapse.message.store.impl.jms.JmsStore" name="glisMessageStore" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="store.jms.destination">glisQueue</parameter>
<parameter name="store.producer.guaranteed.delivery.enable">false</parameter>
<parameter name="store.jms.cache.connection">true</parameter>
<parameter name="java.naming.factory.initial">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="connectionfactory.QueueConnectionFactory">amqp://admin:admin#clientID/carbon?brokerlist='tcp://localhost:5675'</parameter>
<parameter name="store.jms.JMSSpecVersion">1.1</parameter>
</messageStore>
As you can see my documents are putted into the glisQueue queue.
Then I deployed (with this project) a Message Processor named glisMessageProcessor that check if the queue is not empty and if it contains some XML documents it send to and external web service performing an Http call, this is the configuration of my message processor:
<?xml version="1.0" encoding="UTF-8"?>
<messageProcessor class="org.apache.synapse.message.processor.impl.forwarder.ScheduledMessageForwardingProcessor" messageStore="glisMessageStore" name="glisMessageProcessor" targetEndpoint="glisEndpoint" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="client.retry.interval">1000</parameter>
<parameter name="max.delivery.attempts">4</parameter>
<parameter name="member.count">1</parameter>
<parameter name="message.processor.reply.sequence">glisResponseSequence</parameter>
<parameter name="max.delivery.drop">Disabled</parameter>
<parameter name="interval">1000</parameter>
<parameter name="is.active">true</parameter>
</messageProcessor>
As you can see it is using the glisMessageStore as data source (so it is using the glisQueue queue defiend in it to obtain the data to send) and send these data to the glisEndpoint that is the endpoint of my web service (it is defined in my project).
It works fine, the data are correctly sended to the external web service represented by the glisEndpoint.
My only problem is: my web service returns a message when is called (containing some information that I need to store in some way).
Can I configure in some way my glissMessageProcessor to retrieve these response message and put it in a log file?
You just have to use log mediator inside the sequence named "glisResponseSequence" : this is what you've defined with "message.processor.reply.sequence" parameter ant this is where goes the response.

NullPointer reference sending message on RabbitMQ transport

When sending from ESB 4.9.0 API to RabbitMQ with this transport string:
<send>
<endpoint>
<address name="scalehouse_001_rabbitmq" trace="enable" uri="rabbitmq:/ScaleHouses?rabbitmq.server.host.name=localhost&rabbitmq.server.port=5672&rabbitmq.server.user.name=guest&rabbitmq.server.password=guest&rabbitmq.queue.name=scalehouse_001"/>
</endpoint>
</send>
I get this error:
java.lang.NullPointerException at org.apache.axis2.transport.rabbitmq.RabbitMQMessage.<init>(RabbitMQMessage.java:43) at org.apache.axis2.transport.rabbitmq.RabbitMQSender.sendOverAMQP(RabbitMQSender.java:84) at org.apache.axis2.transport.rabbitmq.RabbitMQSender.sendMessage(RabbitMQSender.java:72) at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112) at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442) at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.send(DynamicAxisOperation.java:185) at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:167) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149) at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:542) at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:79)
Does anyone have experience with RabbitMQ transport, and can provide insight into potential causes?
I think the issue is in your axis2.xml configuration. Please follow the below steps.
under the transport receivers section in axis2.xml, find the rabbitmq transport receiver and replace it with your configuration. A sample configuration is given here to help you.
<transportReceiver name="rabbitmq" class="org.apache.axis2.transport.rabbitmq.RabbitMQListener">
<parameter name="AMQPConnectionFactory" locked="false">
<parameter name="rabbitmq.server.host.name" locked="false">localhost</parameter>
<parameter name="rabbitmq.server.port" locked="false">5672</parameter>
<parameter name="rabbitmq.server.user.name" locked="false">guest</parameter>
<parameter name="rabbitmq.server.password" locked="false">guest</parameter>
<parameter name="rabbitmq.connection.retry.interval" locked="false">10000</parameter>
<parameter name="rabbitmq.connection.retry.count" locked="false">5</parameter>
</parameter>
</transportReceiver>
From above configuration WSO2 ESB can act as a RabbitMQ consumer. Then locate the transport sender element in axis2.xml for the rabbitmq and uncomment it. A sample configuration for rabbitmq sender is given below.
<transportSender name="rabbitmq" class="org.apache.axis2.transport.rabbitmq.RabbitMQSender"/>
After applying this line of code, WSO2 ESB can act as a RabbitMQ producer where it can produce messages to a given RabbitMQ queue or topic.
For more on this you can find here.
http://ravindraranwala.blogspot.com/2015/09/rabbitmq-transport-in-wso2-esb.html

SOAP-request isn't dispatched by QName of the first body child element

I have a service described with this WSDL. When its operation createService is invoked with this request everything is fine. For this service a proxy service has been made on WSO2 ESB 4.6.0. Here is WSDL generated by ESB for the proxy service. When I try to send the same request to the proxy service with soapUI the following error occurs:
The endpoint reference (EPR) for the Operation not found is
/services/test.testHttpSoap11Endpoint and the WSA Action = . If this
EPR was previously reachable, please contact the server administrator.
Sending this request's body with ESB's proxy service testing tool I have no problem. I think it's because this tool uses WS-Addressing to send it. The request is also sent smoothly with soapUI if endpoint URL is appended by ?createRequest. According to this article a cause of the problem is SOAPMessageBodyBasedDispatcher. For some reason it doesn't recognize target operation by QName of the first child of the SOAP body element. But I can't understand why SOAPMessageBodyBasedDispatcher screws up in my case. Any ideas?
The main difference among WSO2 ESB 4.6.0 and earlier versions is WSO2 ESB 4.6.0 enable Passthrough Transport (PTT) by default. PTT is used to achieve very high performance boost in WSO2 ESB you can find some numbers here http://wso2.org/library/articles/2013/01/esb-performance-65.
The main problem with your use case is it expect SOAPMessageBodyBasedDispatcher to dispatch operation name. SOAPMessageBodyBasedDispatcher build the message and use first child's local name for dispatching this operation is considered as very costly and hence for the moment not supported in PPT. For the time being you can send expected SOAPAction as a HTTP header to get rid of this issue. In this thread I have provided few other solutions Error accesing published WS proxy in WSO2 ESB 4.6: EPR not found
Changing httpGetProcessor won't help here you have to change transportSender and transportReceiver configuration. You can comment out existing PTT transportSender/transportReceiver and uncomment NHTTP transportSender/transportReceiver configurations on axis2.xml file.
This is what you have on ESB 4.6.0
<transportSender name="http" class="org.apache.synapse.transport.passthru.PassThroughHttpSender">
<parameter name="non-blocking" locked="false">true</parameter>
</transportSender>
<transportReceiver name="http" class="org.apache.synapse.transport.passthru.PassThroughHttpListener">
<parameter name="port" locked="false">8280</parameter>
<parameter name="non-blocking" locked="false">true</parameter>
<parameter name="httpGetProcessor" locked="false">org.wso2.carbon.transport.nhttp.api.PassThroughNHttpGetProcessor</parameter>
</transportReceiver>
What you need is
<transportReceiver name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOListener">
<parameter name="port" locked="false">8280</parameter>
<parameter name="non-blocking" locked="false">true</parameter>
<parameter name="httpGetProcessor" locked="false">org.wso2.carbon.transport.nhttp.api.NHttpGetProcessor</parameter>
<parameter name="disableRestServiceDispatching" locked="false">true</parameter>
</transportReceiver>
<transportSender name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSender">
<parameter name="non-blocking" locked="false">true</parameter>
</transportSender>