Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This section explains, through an example scenario, how the Message Broker EIP can be implemented using WSO2 ESB. The following topics are covered:

Table of Contents
maxLevel5

...

  1. Download a binary version of WSO2 Message Broker from http://wso2.com/products/message-broker, and extract the distribution, which will be referred to as <MB_HOME>.
  2. Open <MB_HOME>/repository/conf/carbon.xml file, and change the offset of ports to 1. This is done to ensure that there will be no port conflicts when you run multiple WSO2 products simultaneously on the same server.

    Code Block
    <Ports>
    <Offset>1</Offset>
    ...
  3. Change If you are using WSO2 MB version 2.0.0 or 2.1.0, change the default virtual host to carbon in <MB_HOME>/repository/conf/advanced/qpid-virtualhosts.xml file.

    Code Block
    <virtualhosts>
        <default>carbon</default>
    ...
  4. Start WSO2 MB server by executing wso2server.sh (or wso2server.bat in Windows) file in the <MB_HOME>/bin directory.

...

Simulating the sample scenario

Send a request using Stock Quote client to the proxy service in the following manner. For information on the Stock Quote client, refer to the Sample Clients section in WSO2 ESB documentation. 

ant stockquote -Dtrpurl=http://localhost:8280/services/StockQuoteProxy -Dsymbol=WSO2

Note that the request is stored in WSO2 Message Broker. Any consumer can access the stored message by accessing destinationMyQueue in WSO2 Message Broker.

How the implementation works

...

  • jms:/myqueue - Looks for a JNDI entry myqueue (see JNDI properties above).
  • ? - Separator indicating extra attributes.
  • transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory - Looks up ConnectionFactory in JNDI with name QueueConnectionFactory.
  • &amp;  - Separator (this will convert to ‘&’)
  • java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory - Uses the andes properties-based JNDI.
  • &amp;  - Another separator (this will convert to ‘&’)
  • java.naming.provider.url=repository/conf/jndi.properties - Looks in repository/conf/jndi.properties for the JNDI properties file.