Table of Contents
The petals-bc-jms component can expose as a JBI ServiceEndpoint an external JMS Queue or JMS Topic. This is done by deploying a Service Unit on it.
When a message is received from the JBI environment, it is transform into a JMS TextMessage and sent or published on the Queue or Topic.
![]() | Caution |
|---|---|
Due to the JMS paradigm, you can only send |
![]() | Caution |
|---|---|
The external Queue or Topic referenced by the Service Unit has to be available before you start the Service Unit. |
The Service Unit descriptor file ( jbi.xml
) looks like this :
<jbi version="1.0"
xmlns='http://java.sun.com/xml/ns/jbi'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:petals="http://petals.objectweb.org/"
xmlns:extensions="http://petals.objectweb.org/extensions/"
xmlns:keyvalue="http://petals.objectweb.org/extensions/key-value/">
<services binding-component="true">
<provides interface-name = "SendOnDestination"
service-name = "petals:SendOnTopic"
endpoint-name = "SendOnTopicEndpoint">
<extensions:extensions>
<keyvalue:extension>
<address>scn://localhost:26400#myTopic</address>
<initial-context-factory>fr.dyade.aaa.jndi2.client.NamingContextFactory</initial-context-factory>
<connection-factory>myConnectionFactory</connection-factory>
<user>root</user>
<password>false</password>
<transacted>false</transacted>
<wsdl>myserviceDefinition.wsdl</wsdl>
</keyvalue:extension>
</extensions:extensions>
</provides>
</services>
</jbi>JMS communication attributes :
Table 2.1. service-unit attributes to provide services
| Attribute | Description | Default | Required |
|---|---|---|---|
| provides | Name of the JBI service that will be activated to expose the JMS Destination into the JBI environment. interface (qname), service (qname) and endpoint (string) name are required. | Yes | |
| address | Address composed of the URL provider (JNDI access) and the destination namewhere messages will be sent. | Yes | |
| initial-context-factory | The initial-context-factory class name, used to create an InitalContext. | Yes | |
| connection-factory | name of the JMS ConnectionFactory registered. | Yes | |
| user | User name to access the JMS Destination. | "" | No |
| password | Password to access the JMS Destination. | "" | No |
| transacted | JMS communication transacted mode. true or false. | "false" | No |
Extra attributes :
Table 2.2. service-unit extra attributes to provide services
| Attribute | Description | Default | Required |
|---|---|---|---|
| wsdl | URL of the WSDL definition.Supported URL protocols are http, https and file ones. You can also provide the path to the WSDL file has a relative address from the deployed SU (like ../../mywsdlfile.wsdl for example). | No | |
| pool-size | Define the number of threads that will listen on JBI to intercept messages. | "1" | No |
The Service Unit has to contain the following elements, packaged in an archive:
The META-INF/jbi.xml descriptor file, has described above,
The JAR library containing the JNDI InitialContextFactory code for the JMS provider implementation,
An optional wsdl file describing the related service
service-unit.zip
+ META-INF
- jbi.xml (as defined above)
- service.wsdl (optional)
- jmsClientLibrary.jarThe petals-bc-jms component can listen to an external JMS Queue or JMS Topic and send the message to a JBI ServiceEndpoint. We say that the component consumes the JBI service.
When a message is received from the JMS server (the component listens to the JMS Queue or has subscribed to a JMS Topic), it is transform into a JBI Message and sent to the JBI ServiceEndpoint configure in the Service Unit.
![]() | Caution |
|---|---|
Due to the JMS paradigm, only |
![]() | Caution |
|---|---|
The external Queue or Topic referenced by the Service Unit has to be available before you start the Service Unit. |
The Service Unit descriptor file ( jbi.xml
) looks like this :
<jbi version="1.0"
xmlns='http://java.sun.com/xml/ns/jbi'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:petals="http://petals.objectweb.org/"
xmlns:extensions="http://petals.objectweb.org/extensions/"
xmlns:keyvalue="http://petals.objectweb.org/extensions/key-value/">
<services binding-component="true">
<consumes interface-name = "SomeJBIServiceInterface"
service-name = "SomeJBIService"
endpoint-name = "SomeJBIServiceEndpoint">
<extensions:extensions>
<keyvalue:extension>
<address>scn://localhost:26400#myTopic</address>
<initial-context-factory>fr.dyade.aaa.jndi2.client.NamingContextFactory</initial-context-factory>
<connection-factory>myConnectionFactory</connection-factory>
<user>root</user>
<password>false</password>
<transacted>false</transacted>
</keyvalue:extension>
</extensions:extensions>
</consumes>
</services>
</jbi>JMS communication attributes :
Table 2.3. service-unit attributes to consume services
| Attribute | Description | Default | Required |
|---|---|---|---|
| consumes | Name of the JBI service that will be called into the JBI environment. When a JMS message is received. Only the interface (qname) name can be proviTo ded (the container will choose a ServiceEndpoint for this interface), or you can only set service (qname) and endpoint (string) names, without the interface name. | Yes | |
| address | Address composed of the URL provider (JNDI access) and the destination name to listen to. | Yes | |
| initial-context-factory | The initial-context-factory class name, used to create an InitalContext. | Yes | |
| connection-factory | name of the JMX ConnectionFactory registered. | Yes | |
| user | User name to access the JMS Destination. | "" | No |
| password | Password to access the JMS Destination. | "" | No |
| transacted | JMS communication transacted mode. true or false. | "false" | No |
Extra attributes :
no extra attribute for this component
The Service Unit has to contain the following elements, packaged in an archive:
The META-INF/jbi.xml descriptor file, has described above,
The JAR library containing the JNDI InitialContextFactory code for the JMS provider implementation
service-unit.zip
+ META-INF
- jbi.xml (as defined above)
- service.wsdl (optional)
-jmsClientLibrary.jar

PEtALS 2.0 & pack (2007/09/28)


![[]](./resources/images/caution.png)


