Question

I am Using Wso2ESB 4.7.0 And ActiveMQ or WSo2message borker 2.1.0

<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

i wish store my messages in my system disk how we can provide a manual store to any Message stor

e like active mq or mwso2 message broker
    <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 process config is like this is it possible to store a failure messages into system disk .if server crashes my data is lost how can i achieve it

Was it helpful?

Solution

Did you try enabling persistence in ActiveMQ? Which version of ActiveMQ do you use? I looked in to ActiveMQ 5.8 and it uses KahaDB which is a file based DB as the default persistence configuration. The persistence approach can be changed based on you requirement.

To enable persistance;

1) Go to file [ActiveMQ_HOME] --> conf --> activemq.xml

2) Check if below configurations are enabled for broker;

<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" persistent="true" dataDirectory="${activemq.data}">
    <persistenceAdapter>
        <kahaDB directory="${activemq.data}/kahadb"/>
    </persistenceAdapter>

  • Within broker tag, attribute set to persistent="true".
  • configurations are pointing to KahaDB.

The default KahaDB files can be found under the below location;

[ActiveMQ_HOME]/data/kahadb/

Check if this satisfies your requirement. For more information, please refer ActiveMQ Persistence. The latter part contains KahaDB persistence configurations.

BTW in ActiveMQ console, what is refered to as "Messages Enqueued" is the count since last reset. This will set to 0 whenever you restart the server. The actual available message count is shown by the count under "Number Of Pending Messages".

I haven't tried this with WSO2 MB. Will try it sometime and keep you posted.

OTHER TIPS

First of all you have to understand the limitation of the message Store in WSO2 esb. Message Store Serialize the message + other information into java serialized object and stores in JMS Queue. Thus, it is not possible to read back by any other artifacts other than "Message processor" and "Message Store" of wso2 esb. please refer to [1] to understand further where i have explained using illustration.

Furthermore, there are known bugs in ACTIVEMQ [2],[3]. When there is more than 100 message in your queue and try to access the Queue manually . ActiveMQ get crash.

[1] http://vanjikumaran.blogspot.com/2013/08/jms-messagen-store-and-jms-message.html

[2] https://issues.apache.org/jira/browse/AMQ-4372

[3] https://issues.apache.org/jira/browse/AMQ-4595

Here you mentioned data store as a queue (ie: faisal5_Queue), SO data will be stored in that queue..If it is JMS queue, you can store only in the queues ..not at filesystem..

If you are using JMS Message Store, even if the server crashes, the messages which were enqueued before (and processing not yet completed) will still be there. This is because the messages are persisted in the JMS queue. If you use In Memory Message Store, upon server crash, your messages will be lost.

In JMS case, you can browse any pending messages inside message store or message processor by clicking on the name link of each store/ processor instance. To be able to browse the messages inside the processor, the processor should be in inactive state. But upon server restart, the messages seems to vanish in ESB 4.7.0. Will look in to this further and keep you posted.

I tried with ActiveMQ case and figured that the error message details can be viewed there for failed messages.

1) Log in to ActiveMQ console.

2) Click on "Queues".

3) Click on your message store queue name. List of pending messages will be displayed.

4) Click on a message id. The message details will be displayed, including the failure message.

Hope this helped.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top