0
votes

I'm trying to setup the following scenario using ESB and Message Broker.

Flow 1:

Client 1 Sends the message to ESB -> ESB consumes the message and stores it into the queue -> End of flow 1;

Flow 2:

Client 2 sends a request to ESB to get messages -> ESB gets the messages from the queue defined for Client 2 -> ESB sends back a pack of message that were present in the queue

While there's no problems to implement Flow 1. Documentation and examples refer to store and forward pattern so I didn't see any live examples on consuming message upon clients request - the "store and pull" model.

Could anyone advise please?

Reference links: http://docs.wso2.org/wiki/display/ESB460/Sample+702%3A+Introduction+to+Message+Forwarding+Processor

http://docs.wso2.org/wiki/display/MB201/Integrating+WSO2+ESB

Best Regards, Vladimir.

3

3 Answers

0
votes

You can refer to this URL: http://wso2.org/library/articles/2013/03/configuring-wso2-esb-wso2-message-broker

I am also struck on Flow 2. I am unable to get data from mesaagebroker through my proxy

0
votes

First you need to save your message in a queue

<address uri="jms:/Queue1?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:5672&amp;transport.jms.DestinationType=queue&amp;java.naming.provider.url=repository/conf/jndi.properties" statistics="disable"/>

You need to specify the queue name in the repository/conf/jndi.properties as mentioned here http://docs.wso2.org/wiki/display/MB201/Integrating+WSO2+ESB

Then you can define a proxy with the same name of the JMS queue to consume that queue

<proxy xmlns="http://ws.apache.org/ns/synapse" name="Queue1" transports="jms" startOnLoad="true" trace="disable" statistics="disable">
    <target inSequence="your_in_sequence" outSequence="your_out_sequence" faultSequence="your_fault_sequence"/>
    <parameter name="transport.jms.ContentType">
        <rules>
            <jmsProperty>contentType</jmsProperty>
            <default>application/xml</default>
        </rules>
    </parameter>
</proxy>

You can use this proxy service to consume queue you have used to save the message

0
votes

Well this is more like a custom requirement. You can achive this using a custom class mediator or a connector. [1]

[1] https://docs.wso2.com/display/ESB481/Creating+a+Connector