This section describes how to configure the WSO2 ESB's JMS transport with WSO2 Message Broker (MB). It facilitates message brokering needs of the ESB and helps implement the store and forward messaging pattern.
Follow the instructions below to set up WSO2 MB and WSO2 ESB.
Setting Setting up WSO2 Message Broker
1. Download and install WSO2 MB binary distribution. Instructions can be found in the Installation Guide in the Message Broker documentation . The unzipped MB distribution folder will be referred to as <MB_HOME>.
...
2. WSO2 MB uses a Cassandra server that is bundled with it by default for storage. As the Message Broker's port offset is changed by 1 above, change the Cassandra port accordingly by opening <MB_HOME>/repository/conf/advanced/qpid-virtualhosts.xml file and increasing the port by 1. In this case, it will be 9161 (Default 9160 + 1).
...
title | Note |
---|
...
However, in a production setup, using an external Cassandra server that is capable of handling large volumes of queues is recommended. When an external Cassandra server is used, point the Message Broker to it by editing the value of the <connectionString> accordingly. For information on setting up WSO2 MB with an external server, see the Deployment Guide in the Message Broker Documentation .
Code Block | ||
---|---|---|
| ||
<store> <class>org.wso2.andes.server.store.CassandraMessageStore</class> <username>admin</username> <password>admin</password> <cluster>ClusterOne</cluster> <idGenerator>org.wso2.andes.server.cluster.coordination.TimeStampBasedMessageIdGenerator</idGenerator> <connectionString>localhost:9161</connectionString> </store> |
When an external Cassandra server is used, point the Message Broker to it by editing the value of the <connectionString> accordingly.
3. The default message batch size for browser subscriptions of Message Broker 2.0.1 is a very low value like 2. Increase is 200. If needed, you can increase it to a larger value by adding setting the following parameter as an immediate child of the root <broker> element to property in the <MB_HOME>/repository/conf/advanced/qpidandes-config.xml file.
Code Block | ||
---|---|---|
| ||
<messageBatchSizeForBrowserSubscriptions>100000</messageBatchSizeForBrowserSubscriptions> |
...
Code Block | ||
---|---|---|
| ||
<!-- uncomment this and configure to use connection pools for sending messages> <transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/--> |
Info |
---|
For details on the JMS configuration parameters used in the code segments above, see JMS Connection Factory Parameters. |
...
4. Open <ESB_HOME>/repository/conf/ JNDIjndi.properties file and point to the running Message Broker.
- Use carbon as the virtualhost.
- Comment out the topic, as it is not needed. But, in order to avoid the error javax.naming.NameNotFoundException: TopicConnectionFactory during server startup, also point TopicConnectionFactory to the Message Broker.
Anchor jndi jndi
For example:
Code Block |
---|
# register some connection factories # connectionfactory.[jndiname] = [ConnectionURL] connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673' connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673' |
...