...
This example has a client application, JmsClient JMSClient, which sends a SOAP message to a ServiceMix binding component called myComponent. myComponent forwards the request to the PXE BPEL engine and waits for a response. JmsClient JMSClient places a book order and myComponent receives the order and sends it to the Webservice that takes orders. The client, JmsClient, and the binding component, myComponent, communicate via JMS. myComponent and the PXE service engine communicate over the Normalized Message Router (NMR). This example uses PXE integration to demonstrate the use of BPEL with ServiceMix.
...
- From a command shell, go to the BPEL example directory:
whereCode Block cd [servicemix_install_dir]\examples\bpel
servicemix_install_dir
is the directory in which ServiceMix was installed. - Then type:
Code Block [servicemix_install_dir]\bin\servicemix servicemix.xml OR ..\..\bin\servicemix servicemix.xml
- To trigger the BPEL business process, send it some messages. To do this, compile and run a simple JMS client. The client is built and run from source code using Ant. Execute ant from the BPEL directory:
servicemix_install_dir\examples\bpel
. To run the JMS client type:Code Block ant
Ant will compile and run the simple JMS client, JmsClient JMSClient, which performs a JMS based request-response into the ServiceMix container before returning the results to the console.
...
The logical flow of the program is:
- The JmsClient JMSClient through ActiveMQConnectionFactory connects to the topic, "demo.org.servicemix.source" and sends a text message containing the
message.soap
file. - myComponent, being a subscriber of the topic "demo.org.servicemix.source," receives the message.
- The myComponent implementation class, JmsServiceComponent, sends the message over the ServiceMix bus to the PxeBpelEngine by executing its onMessage() method. The destinationService property defines the destination of the message. Note: the destinationService property is found in the
servicemix.xml
file. - PxeBpelEngine sends a response back to myComponent through the ServiceMix bus, the NMR.
- myComponent uses the jmsTemplate bean to publish the message.
- jmsTemplate uses the jmsFactory bean to get a connection to the port associated with the JMS topic called "demo.org.servicemix.source." The message is published on the "demo.org.servicemix.source" topic.
- JmsClient JMSClient being a subscriber of topic "demo.org.servicemix.source," receives the message.
- The response is printed on the console.
...
Component or Bean ID | Description |
---|---|
jbi | jbi is the "id" of the JBI container and provides the basic infrastructure services for myComponent. During initialization, several singletons are instantiated: transactionManager, broker, jmsFactory, and jbi. Also, take note of the properties installationDirPath and deploymentDirPath defined in |
JMSClient | This Java standalone program, through the ActiveMQConnectionFactory, connects to topic "demo.org.servicemix.source." It then create creates a text message from the file |
myComponent | This JMS service component subscribes to the "demo.org.servicemix.source" topic via its defaultDestinationName property specified on in the |
JNDI jndi | This bean loads up database and transaction manager resources, which will be used by the other components in the system. More importantly, the JNDI context must be configured so that PXE can be deployed. |
Pxe-install.jar | This jarfile is located in the |
AsyncProcess-sa.jar | This jarfile is located in the |
broker | The broker bean uses the |
transactionManager | This bean is configured to be the default transaction manager for the jbi container. jencks is also configured to use the default transaction manager. This transaction manager provides transactional services between the resource adapter (in this case the ActiveMQ resource adapter provided by the jencks JCA container) and components in the jbi container. |
jmsFactory | This bean listens on port 61616 and provides a pooled ActiveMQ connection. |
...