|| {color:#333333}Parameter{color} || {color:#333333}Description{color} || {color:#333333}Default{color} || {color:#333333}Required{color} ||
| 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) | \- | Yes |
| destination-name | The JMS destination name where messages will be sent (Queue or Topic JNDI name) | \- | 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. | "" | Yes |
| password | Password to access the JMS Destination. | "" | Yes |
| transacted | JMS communication transacted mode. true or false. | false | Yes |
| max-active | Controls the maximum number of JMS connections that can be borrowed from the pool at one time. When non-positive, there is no limit to the number of connections that may be active at one time. When maxActive is exceeded, the pool is said to be exhausted. | 10 | No |
| max-idle | Controls the maximum number of JMS connections that can sit idle in the pool at any time. When negative, there is no limit to the number of connections that may be idle at one time. | 5 | No |
| max-wait | If a positive maxWait value is supplied, the JMS component will wait for at most that many milliseconds to retrieve an available JMS connection. If maxWait is non-positive, the component will wait indefinitely. | 10000 | No |
| time-between-eviction-runs-millis | Indicates how long the eviction thread should sleep before "runs" of examining idle connections. When non-positive, no eviction thread will
be launched. | 10000 | No |
| min-evictable-idle-time-millis | Specifies the minimum amount of time that a connection may sit idle in the pool before it is eligable for eviction due to idle time. When non-positive,
no connections will be dropped from the pool due to idle time alone. | 2000 | No |
| test-while-idle | Indicates whether or not idle connections should be validated. Connections that fail to validate will be dropped from the pool. | true | No |
{table-plus}
{center}{*}Advanced configuration of Service Unit (provides elements)*{center}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;",style="text-align:center;"}
|| {color:#333333}Parameter{color} || {color:#333333}Description{color} || {color:#333333}Default{color} || {color:#333333}Required{color} ||
| wsdl | Path to a wsdl file describing services and operations offered by an endpoint activated by the SU. This extension is only usable with provides fields. \\
The path can be a url "http" or "file" or relative to the r oot directory of the SU archive. Ex: "file:///user/ofabre/test.wsdl" or "/WSDL/test.wsdl". \\
If no wsdl path is specified, a simplified description will automaticaly be written by the CF. | \- | No |
{table-plus}
h3. Service Unit content
The Service Unit has to contain the following elements, packaged in an archive:
* The META-INF/jbi.xml descriptor file, has described above
* An optional WSDL file describing the related service.
{code}
service-unit.zip
+ META-INF
- jbi.xml (as defined above)
- service.wsdl (optional)
{code}
h1. Consuming a message from a JMS Queue
This use case is similar to [subscribing to a JMS topic|#Subscribing-to-a-JMS-Topic].
h1. Subscribing to a JMS Topic
{center}!petals-bc-jms-consume_service.png|width=600px!{center}
{center}_Consumes a JBI service on JMS message_{center}
h2. Usage
The Petals JMS component can listen to an external JMS Queue or JMS Topic.
When it receives a message, it creates a Petals message and sends to a Petals service (we say that the component consumes the JBI service). This service is specified in the Service Unit.
{note}
* All MEP are allowed. But, due to the JMS paradigm, all exchanges are processed like *InOnly* exchanges.
* The external Queue or Topic referenced by the Service Unit has to be available before you start the Service Unit.
{note}
h2. Configuration
h3. Service Unit Descriptor
The Service Unit descriptor file ( jbi.xml ) looks like this:
{code}<?xml version="1.0" encoding="UTF-8"?>
<!--
JBI descriptor for the Petals' "petals-bc-jms" component (JMS).
Originally created for the version 3.1 of the component.
-->
<jbi:jbi version="1.0"
xmlns:generatedNs="http://petals.ow2.org"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:jms="http://petals.ow2.org/components/jms/version-3"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- Import a Service into Petals or Expose a Petals Service => use a BC. -->
<jbi:services binding-component="true">
<!-- Expose a Petals Service => consumes a Service. -->
<jbi:consumes
interface-name="generatedNs:itf"
service-name="generatedNs:srv"
endpoint-name="srvEndpoint">
<!-- CDK specific elements -->
<petalsCDK:timeout>30000</petalsCDK:timeout>
<petalsCDK:operation xmlns:wedontcareNs="http://something">wedontcareNs:wedontcare</petalsCDK:operation>
<petalsCDK:mep>InOnly</petalsCDK:mep>
<!-- Component specific elements -->
<jms:jndi-provider-url>tcp://localhost:61616</jms:jndi-provider-url>
<jms:jndi-initial-context-factory>org.apache.activemq.jndi.ActiveMQInitialContextFactory</jms:jndi-initial-context-factory>
<jms:jndi-destination-name>dynamicTopics/PetalsTopic</jms:jndi-destination-name>
<jms:jndi-connection-factory>ConnectionFactory</jms:jndi-connection-factory>
<jms:transacted>false</jms:transacted>
</jbi:consumes>
</jbi:services>