Pergunta

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
Foi útil?

Solução

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"/>

Outras dicas

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top