Integrating Apache ActiveMQ with ActiveVOS A Step by Step Guide AN ACTIVE ENDPOINTS TECHNICAL NOTE 2009 2010 Vlad Orzhekhovskiy (Charter Global) 2010 Active Endpoints Inc. ActiveVOS is a trademark of Active Endpoints, Inc. All other company and product names are the property of their respective owners. 2010
Content Overview... 3 Step by Step Guide... 3 Acknowledgments... 7 About Active Endpoints... 7 Copyright 2010. Active Endpoints, Inc. Page 2 of 7
Overview This technical note describes the steps necessary to enable the ActiveVOS server to use Apache ActiveMQ as the transport for SOAP/JMS communication. Step by Step Guide 1. Make sure Apache ActiveMQ is installed, up and running. 2. Install ActiveVOS and configure it according to the container where it is deployed (e.g. JBoss, Tomcat, etc.) and the database in use (e.g. Oracle, MySQL, etc.). 3. Copy activemq all xxx.jar file from your ActiveMQ installation to the container s library folder, so that it would be picked up by the container at the start up. For instance, for Tomcat 5.5 it would be tomcat home/common/lib. 4. Launch the server that provides the container for ActiveVOS and make sure starts without error. 5. Using the server management console, make sure all ActiveVOS components have started. Those include active bpel (the engine), activevos (management console), and activevos central (user tasks). 6. Open your web browser and bring up the ActiveVOS console; by default, it is deployed at the http://server:port/activevos URL where the server and port point to the ActiveVOS container. For instance, for Apache Tomcat server running on your box with the default configuration, the URL will be http://localhost:8080/activevos 7. Choose ADMIN from the top menu in the ActiveVOS console. 8. Choose Messaging Service under Configure Services in the left pane. 9. In the main panel, type in a name for the JMS Manager (can be anything; for instance, Local ActiveMQ, ActiveMQ@dev.box, etc.) and click Add Manager. 10. The screen will be updated, and you will see your new manager in the list. Click on it to go to the manager configuration screen. 11. Under the JMS Messaging Configuration : <name> title set the following parameters as shown on the screenshot shown here: Copyright 2010. Active Endpoints, Inc. Page 3 of 7
12. Under the Initial Context Properties set the two mandatory parameters for JNDI factory name and provider URL (make sure to specify the correct host and port according to the ActiveMQ configuration), plus mappings for all the message queues that ActiveVOS will be interacting with either as service provider, or service consumer. For example, if a certain BPEL process is to be invoked through SOAP/JMS via queue1, and then it calls some other external service also through SOAP/JMS via queue2 then both input and output queues need to be declared here. Each such property defines a mapping from a JNDI queue name to the physical name of the queue to be accessed, as it has been defined in ActiveMQ. The JNDI name can be anything, but (at the time of writing) it cannot contain the forward slash character ( / ), as it causes an error in ActiveVOS configuration. A sample configuration is shown below. Each JNDI name must be prefixed with queue., which instructs the context factory to inject a queue name into the context. 13. Finally, under Queues & Listeners, define all queues that ActiveVOS needs to be listening to i.e. those queues that serve as transport for messages, triggering BPEL processes. In the example above that would be queue1. A queue declaration includes a JNDI queue name (as defined in step 12), and optionally the name of the default service i.e. the service that will be called, if the input message picked up from this queue, does not specify it. The Queue Name parameter specifies the name of the listener and can be anything: Copyright 2010. Active Endpoints, Inc. Page 4 of 7
14. You will need to redeploy the ActiveVOS, or restart the container, for the changes to take effect. If you see an error message during ActiveVOS startup indicating that it cannot find a queue to listen to, it means that a queue defined in step 13 ( Queues & Listeners ) does not have a match among queues defined in step 12 ( Context Properties ). Copyright 2010. Active Endpoints, Inc. Page 5 of 7
15. Now, let s say your BPEL process needs to call an external service MyService using SOAP/JMS via message queue queue 2 (as mentioned in p.10). Provided that your queue has been declared with JMS Provider as shown in p.10, the address of the external process specified in the deployment descriptor for that BPEL project may look like this (note, that if you want to use a persistent reply queue, it needs to be also registered with the JMS provider): <pdd:partnerlink name="serviceprovider"> <pdd:partnerrole endpointreference="static" invokehandler="jms:address"> <wsa:endpointreference xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:ns5="http://you.service.namespace" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <wsa:address>jndi_queue_name2?myservice</wsa:address> <!-- Uncomment this, if you want to use a persistent queue for responses <wsa:referenceparameters> <wsa:replyto xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschemainstance"> <wsa:address>jndi_reply_queue_name</wsa:address> </wsa:replyto> </wsa:referenceparameters> --> <wsp:policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:abp="http://schemas.activeendpoints.com/ws/2005/12/policy"> <abp:jmsdeliveryoptions jmsmessageformat="soap" jmsmessagetype="text"/> </wsp:policy> </wsa:endpointreference> </pdd:partnerrole> </pdd:partnerlink> Copyright 2010. Active Endpoints, Inc. Page 6 of 7
Acknowledgments Active Endpoints extends its thanks to Vlad Orzhekhovskiy (Charter Global) for contributing the content of this technical note. About Active Endpoints Active Endpoints (www.activevos.com) ActiveVOS is the business process management system (BPMS) that development teams will love. ActiveVOS empowers project teams to create business process management (BPM) applications using services, making their businesses more agile and effective. ActiveVOS promotes mass adoption of SOAenabled BPM applications by focusing on accelerating project delivery time with a complete, affordable and easy to use system. Active Endpoints is headquartered in Waltham, MA with development facilities in Shelton, CT. To find out how Active Endpoints can help your business, visit http://www.activevos.com, call +1 781 547 2900 and press 1 for Sales, or email us at info@activevos.com. Copyright 2010. Active Endpoints, Inc. Page 7 of 7