Showing posts with label ActiveMQ setup. Show all posts
Showing posts with label ActiveMQ setup. Show all posts

Wednesday, April 22, 2015

Setup WSO2 ESB server and ActiveMQ server (Part 3) - WSO2 ESB and ActiveMQ connection


I've installed WSO2 and ActiveMQ in the past two blogs.
Setup WSO2 ESB server and ActiveMQ server (Part 1) - Installation
Setup WSO2 ESB server and ActiveMQ server (Part 2)

The WSO2 ESB server - Console URL is https://localhost:9443/carbon/admin/login.jsp
ActiveMQ server - Console URL is http://localhost:8161/admin/queues.jsp

The next we will verify the connection of WSO2 and ActiveMQ.
1. Create a new JMS proxy service. (The same way as in part 2)


2. Replace the source with the following xml doc.

 <?xml version="1.0" encoding="UTF-8"?>  
 <proxy xmlns="http://ws.apache.org/ns/synapse"  
     name="echoJmsProxy"  
     transports="https,http"  
     statistics="disable"  
     trace="disable"  
     startOnLoad="true">  
   <target>  
    <endpoint>  
      <address uri="jms:/EchoQueue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;  
      java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;  
      java.naming.provider.url=tcp://localhost:61616"/>  
    </endpoint>  
   </target>  
   <publishWSDL uri="http://localhost:9763/services/echo?wsdl"/>  
   <parameter name="OUT_ONLY">true</parameter>  
   <parameter name="FORCE_SC_ACCEPTED">true</parameter>  
   <description/>  
 </proxy>  

 



3. Click Try this service.
Modify the attribute and click send.


4. Now login to ActiveMQ. We can see there is a message in the queue.


It verified the WSO2 ESB and ActiveMQ connected successfully.




Thursday, April 16, 2015

Setup WSO2 ESB server and ActiveMQ server (Part 1) - Installation

I have a new project which need to post an xml with a data range to a third party url, then get an xml response back, at last to process the response xml message and save it into database.
I've done this kind of job by using pure java code or Talend ETL open studio.

This time I am trying to using WSO2 ESB server and ActiveMQ server to finish the job.

1. Install ESB and ActiveMQ
 I need to install WSO2 ESB server and ActiveMQ server in my local machine,
These are the version I installed in my local.


2. ESB/ActiveMQ configuration


1) Copy relevant JMS client libraries to WSO2 ESB.
For Apache ActiveMQ, copy
[ActiveMQ_HOME]/lib/
activemq-broker-5.8.0
activemq-client-5.8.0,
geronimo-j2ee-management_1.1_spec-1.0.1.jar and
geronimo-jms_1.1_spec-1.1.1.jar
hawtbuf-1.9

to
[WSO2 ESB HOME]/repository/components/lib

2)  To enable JMS queues, define JNDI in [WSO2 ESB Home]\repository\conf\jndi.properties
connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/test?brokerlist='tcp://localhost:61616'

3) Enable JMS Receiver
Edit  Axis2 configuration file ([ESB Home] \repository\conf\axis2\axis2.xml
Uncomment <transportReceiver> section under “<!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ) -->”

4) Enable JMS Sender
  <!-- uncomment this and configure to use connection pools for sending messages> -->
  <transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/>



3. Start server to verify

Go to [wso2esbhome]\bin directory
run wso2server.bat

Go to [activemq home]\bin 
run activemq.bat

Then I can go to console to verify if the servers are on.

The WSO2 ESB server - Console URL is https://localhost:9443/carbon/admin/login.jsp
ActiveMQ server - Console URL is http://localhost:8161/admin/queues.jsp

The user name and password for both servers are admin/admin.

If everything is correct, we can land on the following web console page.