0

I have done the all process which is required for message store and forwarding process Installed activeMQ 5.5.1 and Copied necessary Jars in WSO2eSb Changed the AXIS2 file configurations also like this

<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
        <parameter name="myTopicConnectionFactory" locked="false">
            <parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
            <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
            <parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter>
        </parameter>

        <parameter name="myQueueConnectionFactory" locked="false">
            <parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
            <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
            <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
        </parameter>

        <parameter name="default" locked="false">
            <parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
            <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
            <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
        </parameter>
    </transportReceiver>

INFO - JMSSender JMS Sender started [2013-07-23 17:02:18,752] INFO - JMSSender JMS Transport Sender initialized... after this i created JMS MESSAGE STORE <

messageStore name="faisal" 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">transport.jms.ConnectionFactoryJNDIName</parameter>
   <parameter name="store.jms.JMSSpecVersion">1.1</parameter>
   <parameter name="store.jms.cache.connection">false</parameter>
</messageStore>

and Add Scheduled Message Forwarding Processor with that

<messageProcessor name="process5" class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor" messageStore="faisal" xmlns="http://ws.apache.org/ns/synapse">
   <parameter name="interval">1000</parameter>
   <parameter name="max.delivery.attempts">10</parameter>
   <parameter name="message.processor.reply.sequence">Mail_Seq</parameter>
</messageProcessor>

and my proxy service configuration like this

<proxy xmlns="http://ws.apache.org/ns/synapse" name="Message" transports="https,http,jms" statistics="disable" trace="disable" startOnLoad="true">
   <target>
      <inSequence>
         <property name="faisal" value="faisal" scope="default" type="STRING"/>
         <store messageStore="faisal"/>
         <log level="full"/>
      </inSequence>
      <outSequence>
         <log level="full"/>
      </outSequence>
   </target>
   <description></description>
</proxy>

Storing the message in message store but forwarding is wrong IF endpoint not working eventhough message is processing its lost message in WSO2esb its giving this message

[2013-07-23 17:02:18,817]  WARN - ForwardingJob Property target.endpoint not found in the message context , Hence removing the message 
[2013-07-23 17:02:18,869]  WARN - ForwardingJob Property target.endpoint not found in the message context , Hence removing the message 
[2013-07-23 17:08:07,419]  WARN - JMSMessageStore Consumer Receiving time out is not passed in, Setting to default value of 60 secs
Community
  • 1
  • 1
faisal shaik
  • 160
  • 4
  • 22

2 Answers2

0

This is because you haven't defined a target endpoint. Therefore no place to deliver the message. Therefore the message will be removed. Your synapse configuration does not contain any endpoint.

This blog post might help you.

http://isharaaruna.blogspot.com/2012/09/jms-transports-in-wso2-esb-with-activemq.html

Ushani
  • 1,199
  • 12
  • 28
0

Create an Address Endpoint as follows with the correct uri of backend.

<endpoint xmlns="http://ws.apache.org/ns/synapse" name="Service1EP">
   <address uri="http://localhost:8080/services/service1"">
      <suspendOnFailure>
         <progressionFactor>1.0</progressionFactor>
      </suspendOnFailure>
      <markForSuspension>
         <retriesBeforeSuspension>0</retriesBeforeSuspension>
         <retryDelay>0</retryDelay>
      </markForSuspension>
   </address>
</endpoint>

Then refer that endpoint in your proxy service by adding the following line in your inSequence.

<property name="target.endpoint" value="Service1EP" scope="default" type="STRING"/>
Nufail
  • 1,588
  • 1
  • 17
  • 31
  • thanks for replay ya i got u even though my endpoint is not defined i need stay that message in jms queue not to be lost of any cost neither it will deliver to client nor stay in jms queue how we can achive it – faisal shaik Jul 24 '13 at 07:01
  • Looking at the code I see, if a target endpoint is not found the message will be removed from the message store. You can set a dummy endpoint then it will retry for maximum no. of attempts and stay in the store. Or you can deactivate the message processor so that the message stays in the store. – Nufail Jul 24 '13 at 07:19
  • you mean we dont have any parameter which will help to stay the message in queue without send can i defined sequence endpoint to message processor like this Mail_Seq – faisal shaik Jul 24 '13 at 07:32
  • this is genrated in esb is it useful for any thing y it has been genrated.......jms:/Message?transport.jms.DestinationType=queue&transport.jms.ContentTypeProperty=Content-Type&java.naming.provider.url=tcp://localhost:61616&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&transport.jms.ConnectionFactoryType=queue&transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory – faisal shaik Jul 24 '13 at 07:42
  • If you create a message store all the messages will be stored. When you create a message processor they will be delivered to endpoint defined. Without a msg processor messages will not be sent. "message.processor.reply.sequence" is used to handle the response received after sending it to the endpoint. The responses will be sent to this sequence. – Nufail Jul 24 '13 at 08:21
  • 1 its deactivating continuously how can i overcome this it means i need to active the message processor – faisal shaik Jul 24 '13 at 09:11
  • As "max.delivery.attempts" is 1, it will deactivate after 1 failed attempt to deliver the message. Increase that and also make sure messageStore named 'faisal5' is available. – Nufail Jul 24 '13 at 09:37
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/34055/discussion-between-faisal-shaik-and-nufail) – faisal shaik Jul 24 '13 at 09:47
  • a i have done what u suggested it means how many max.delivary we will give that much times it will execute one more thing after executing also message can stay in message store are its lost how it work actually my scenario is i will get messages from client i need store it and forward it back end service without lost relaibly – faisal shaik Jul 24 '13 at 10:21