Publish to queue in message broker - wso2

I have been working for 1 week on WSO2 solution, I work with Enterprise Integrator 6.4.0.
I ran WSO2 Enterprise Integrator and WSO2 message broker and I can access to management consoles.
On message broker console I created 2 queues:
- Queue1
- Queue2
On Enterprise Integrator console I created a proxy with this code in order to consume messages presents in queue1 and put them in queue2 :
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="PS_JMS_X502a"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="jms,http,https">
<target>
<inSequence>
<property name="OUT_ONLY" value="true"/>
<send>
<endpoint>
<address uri="jms:/queue2?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=conf/jndi.properties&transport.jms.DestinationType=queue"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<parameter name="transport.jms.Destination">queue1</parameter>
<parameter name="transport.jms.ContentType">
<rules xmlns="">
<jmsProperty>contentType</jmsProperty>
<default>text/xml</default>
</rules>
</parameter>
<description/>
</proxy>
It doesn’t work and I don’t know where is the problem … Thanks you very much for your replies.

Related

wso2 quickfixj fix.4.2 message from broker

Good morning everyone,
I have problem when waiting for fix message from my broker to my wso2.
i have setup my proxy for got fix message from them like
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="FIXtoSOAP" startOnLoad="true" transports="fix" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<log level="full" />
<log level="full" />
</inSequence>
<outSequence>
<log level="full" />
</outSequence>
</target>
<parameter name="transport.fix.AcceptorConfigURL">
file:/home/ec2-user/xxxx_server_new/FIXQUoteAcceptor2.cfg
</parameter>
<parameter name="transport.fix.AcceptorMessageStore">file</parameter>
</proxy>
but in my console i cannot see their message in my console. by the way i am new for use FIX transport using wso2.

When SAP call WSO2 listener with bapi, it doesn't wait the answer

SAP calls WSO2 listener with:
CALL FUNCTION 'ZBC_IEBCXX_FONCTION_TEST'
DESTINATION p_dest
...
(P_DEST is an TCP/IP RFC destination with registered server program)
The call is ok and the WSO2 flow works.
But SAP doesn't wait the answer, what must be done to have the call wait the answer (in SAP or in WSO2 flow).
I have tried different DataMapper.
But it seems SAP really doesn't wait, tested with the code below (SAP closes the call function before the sleep 4s is finished)
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="DE1_Listener_To_IE1_100_BAPI" startOnLoad="true" statistics="enable"
trace="enable" transports="bapi" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<script language="js"><![CDATA[java.lang.Thread.sleep(4000);]]></script>
<log level="full"/>
.....
</inSequence>
<outSequence>
<log description="L3" level="full"/>
<datamapper config="gov:datamapper/Call_Back_ZBC_IEBCXX_FONCTION_TEST.dmc"
inputSchema="gov:datamapper/Call_Back_ZBC_IEBCXX_FONCTION_TEST_inputSchema.json"
inputType="XML"
outputSchema="gov:datamapper/Call_Back_ZBC_IEBCXX_FONCTION_TEST_outputSchema.json"
outputType="XML"
xsltStyleSheet="gov:datamapper/Call_Back_ZBC_IEBCXX_FONCTION_TEST_xsltStyleSheet.xml"/>
<log/>
</outSequence>
<faultSequence/>
</target>
<parameter name="transport.sap.serverName">FRIDADEVSAP01</parameter>
<parameter name="transport.sap.enableErrorListener">enabled</parameter>
<parameter name="transport.sap.enableTIDHandler">enabled</parameter>
</proxy>
How to have a complete CALL function to WSO2 (from SAP) asking/receiving the answer?

javax.naming.NameNotFoundException: Name [dynamicQueues/myqueue] is not bound in this Context. Unable to find [dynamicQueues]

I've created JMS sender in WSO2 ESB 4.9.0 as below and configured JMS sender in axis2.xml file. I'm getting the below exception when I run the proxy service. Using Websphere MQ JMS queues.
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="StockQuoteProxy"
transports="http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="OUT_ONLY" value="true"/>
<send>
<endpoint>
<address uri="jms:/myquue?transport.jms.ConnectionFactory=ConnectionFactory"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<description/>
</proxy>
javax.naming.NameNotFoundException: Name [dynamicQueues/myqueue] is not bound in this Context. Unable to find [dynamicQueues]
In my scenario using the WSO2 MB, the correct endpoint it´s this:
<address uri="jms:/MyQueue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/jndi.properties&transport.jms.DestinationType=queue"/>
Your proxy config use:
<property name="OUT_ONLY" value="true"/>
So, no response is sent to the client.
You need to specify a WSDL in the proxy config with an operation that does not have a response message or return a status = 200 with:
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>

How to store the Messages In JMS Queue Using Wso2esb and Activemq

I am using wso2esb4.7.0 and ActiveMQ5.8.0 i wish to store the messages in Queue
for this i try with this code but its not working
i created store which will helpful for storing the messages,my conumeing process has done in JAVA code so i need not worry about the Consuming
if i do it my message will appear in acivemq UI
my config is like this
<messageStore name="JMSQueue" class="org.wso2.carbon.message.store.persistence.jms.JMSMessageStore" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
<parameter name="store.jms.destination">faisal5_Queue</parameter>
<parameter name="store.jms.JMSSpecVersion">1.1</parameter>
<parameter name="store.jms.cache.connection">false</parameter>
</messageStore>
and i am trying to pass the message through the proxy for that i write simple proxy service for that
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="Jms"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="messageType" value="application/json" scope="axis2"/>
<log level="full"/>
<property name="OUT_ONLY" value="true"/>
<store messageStore="JMSQueue"/>
</inSequence>
<outSequence/>
</target>
<description/>
</proxy>
in this case my queue is not creating in Activemq Why its happening
if i create message process then only my QUEUE is appearing in ActiveMQ UI
will you write sample code for this my scenario is simple i wsih to store my client messages without failure they will consume after the storing process
Your proxy and message store are okay, I tested those.
I think you have not correctly Configure the ESB with ActiveMQ.
Follow this link and place the jars as mentioned and edit the Axis2.xml. Then try with your code. It should work
You can simply use the below config to store messages in activemq.
Since you are not using a message processor, it is no need of making a message store. So you can simple store messages in the queue as follows.
<proxy name="JmsProxyTest"
transports="https http"
startOnLoad="true"
trace="disable">
<target endpoint="jmsEndpoint">
<inSequence>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
</inSequence>
<outSequence>
<drop/>
</outSequence>
</target>
<endpoint name="jmsEndpoint">
<address uri="jms:/faisal5_Queue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://127.0.0.1:61616&transport.jms.DestinationType=queue"/>
Also you better check you have configured activemq with esb correctly.
Thanks.

How we can process the Store and Forward Using JMS Message Stores

i have done all the changes in axis2 file and drop the jar files in lib
my message process is working fine and storing also
when ever i am sending request to proxy which consist store mediator and defined target.endpoint also after request message storing in message store its not processing
my configure files
<proxy xmlns="http://ws.apache.org/ns/synapse" name="Message" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<log level="full"/>
<property name="faisal" value="faisal" scope="default" type="STRING"/>
<property name="target.endpoint" value="JmsChecking" scope="default" type="STRING"/>
<store messageStore="faisal5"/>
</inSequence>
<outSequence>
<log level="full"/>
</outSequence>
</target>
<description></description>
</proxy
and message store is
<messageStore name="faisal5" class="org.wso2.carbon.message.store.persistence.jms.JMSMessageStore" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
<parameter name="store.jms.destination">faisal5_Queue</parameter>
<parameter name="store.jms.JMSSpecVersion">1.1</parameter>
<parameter name="store.jms.cache.connection">false</parameter>
</messageStore>
and message processor
<messageProcessor name="faisal" class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor" messageStore="faisal5" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="interval">1000</parameter>
<parameter name="max.delivery.attempts">4</parameter>
</messageProcessor>
and endpoint define which is like this
and its entries
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="JmsChecking">
<address uri="http://localhost:8282/services/JmscheckingEndpoint" format="soap11">
<suspendOnFailure>
<progressionFactor>1.0</progressionFactor>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>0</retriesBeforeSuspension>
<retryDelay>0</retryDelay>
</markForSuspension>
</address>
</endpoint>
end point consist log values proxy
proxy xmlns="http://ws.apache.org/ns/synapse" name="JmscheckingEndpoint" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<log level="custom">
<property name="Message" value="JMs working fine"/>
<property name="value" expression="//mail/text()"/>
</log>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<description></description>
</proxy>
Now i am sending my request
this log value is printing like this
[2013-07-25 11:42:03,039] INFO - LogMediator Message = JMs working fine, value = faisal.shaik#youtility.in
[2013-07-25 11:42:03,039] INFO - LogMediator Message = JMs working fine, value = faisal.shaik#youtility.in
[2013-07-25 11:42:03,039] INFO - LogMediator Message = JMs working fine, value = faisal.shaik#youtility.in
[2013-07-25 11:42:03,039] INFO - LogMediator Message = JMs working fine, value = faisal.shaik#youtility.in
as well as message process is deactivating .if i am send one more request its just storing its not processing bcoz of message process is deactivate state
this JMS work only like this
MY scenario is i will get request if endpoint is available message will deliver and delete as well if endpoint is unavailable message will retry max mention times even also endpoint not available then it will store in message store
what is the use of this parameter will you please explain about this
i followed this link http://docs.wso2.org/wiki/display/ESB460/Store+and+Forward+Using+JMS+Message+Stores
where can i found this faisal5_Queue store point is it exist as folder
<parameter name="store.jms.destination">faisal5_Queue</parameter>
No it does not create a folder. when you mention the "store.jms.destination" using
faisal5_Queue wso2 esb will create an queue in your message broker(In your case ActiveMQ) with your specified name "faisal5_Queue". If you did not mention explicitly, WSO2 esb will create an queue with "YourMessageStoreName_Queue"
you can refer furthermore on these blogs to understand the behaviour of "Message Store" and "Message Processor"
http://vanjikumaran.blogspot.com/2013/08/jms-store-and-jms-processor-behavior.html
http://vanjikumaran.blogspot.com/2013/08/jms-messagenstore-and-jms-message.html
http://vanjikumaran.blogspot.com/2013/08/jms-messagen-store-and-jms-message.html