PEtALS

Two usecases are defined in this section:

  • The send of JMS Messages to the JBI Helloworld Service Engine.

  • The send of JBI Messages to the JMS External provider

This section presents how install the different components and service assemblies to realize these use cases.

In each case, the external JMS Server where the client and provider queue are defined must be started in first.

To install the external JMS server, you must download and extracts the zip archive at this url:

maven.objectweb.org/maven2/org/objectweb/petals/usecase/jms/petals-jms-client/1.0-SNAPSHOT/petals-jms-client-1.0-SNAPSHOT-with-dependencies.zip

This package contains also the external jms Client and Provider used in the next sections

Inserts all jars in your classpath and start the JMS server with the command below:

java org.objectweb.petals.usecase.jms.common.JMSServer

If it is OK, you must see the lines below:

Start JORAM server S0...
...JORAM server S0 started
   (connected)
Initialize JMS service...
   (connect to JORAM server)
   (Creation of the queue: queueConsumer)
   (Queue created)
   (Queue bound)
   (Creation of the queue: queueProvider)
   (Queue created)
   (Queue bound)
   (disconnect from JORAM server)
JMS destinations initialized...

Now, the external JMS Server is ready and the client and provider queues (respectively, queueConsumer and queueProvider) have been created. You can execute the usecases below.

To send a JMS Message to the JBi HelloWorld Service Engine, you must install several components in the order listed below:

  • The HelloWorld Service Engine component (Download here).

  • The JMS binding component (Download here).

  • The sa-jms-consume service assembly (Download here). This service assembly contains two service units:

    1. ths su-jms-consume service unit. This service unit consumes the endpoint defined by the next service unit.

    2. the su-helloworld-provides service unti. This service unit exposes a static endpoint of the helloworld component.

Once these components are installed, you must install the JMS client.

To install the JMS client, you must download and extracts the zip archive at this url:

maven.objectweb.org/maven2/org/objectweb/petals/usecase/jms/petals-jms-client/1.0-SNAPSHOT/petals-jms-client-1.0-SNAPSHOT-with-dependencies.zip

By default, the JMS client is started in console mode.

Inserts all jars in your classpath and start the JMS client with the command below:

java org.objectweb.petals.usecase.jms.client.Client

If it is OK, you must see the lines below:

Start the Echo JMS client...
-------------------------------

The parameters used for this client are listed below:
        -user=anonymous
        -password=anonymous
        -connection-factory=qcf
        -queue-name=queueConsumer
        -file=null
No file has been given in input:
You can write the xml message to send in the console or write 'quit' to exit ...(for instance: <text>hello world</text>)
=> 

You can write an xml message and verify that it has been received by the helloworld component.

If you want that the JMS client send a xml file to the helloworld, you can configure it with the 'file' option as seen below:

java org.objectweb.petals.usecase.jms.common.Client -file=test.xml

the test.xml file is shown below:

<jms>
   <text>Hello World</text>
</jms>

All these components can be seen on Figure 3.1, “the sa-jms-consume use case”


To send a JBI Message to the external JMS provider, you must install several components in the order listed below:

Once these components are installed, you must install the JMS provider.

To install the JMS provider, you must download and extracts the zip archive at this url:

maven.objectweb.org/maven2/org/objectweb/petals/usecase/jms/petals-jms-client/1.0-SNAPSHOT/petals-jms-client-1.0-SNAPSHOT-with-dependencies.zip

Inserts all jars in your classpath and start the JMS provider with the command below:

java org.objectweb.petals.usecase.jms.provider.Provider

If it is OK, you must see the lines below:

Start the JMS Echo services...
-------------------------------

The parameters used for this server are listed below:
        -user=anonymous
        -password=anonymous
        -connection-factory=qcf
        -queue-name=queueProvider
Start the message receiver...
Message receiver started...

... JMS Echo services started...
Creating message receiver...
MsgListener ready to listen for Receiver

Now, the external JMS provider is ready to receive messages. You can use the sample client to send xml message to the endpoint defined by the su-jms-provde service unit.

All these components can be seen on Figure 3.2, “the sa-jms-provide usecase”