View Source

{section}
{column}

h1. Feature

This binding component allows to interact with an external JMS Destination (queue or topic). Service Units are used to map a JMS destination to a JBI ServiceEndpoint. A JBI MessageExchange sent to a ServiceEndpoint (mapped to a JMS destination) is transformed into a JMS TextMessage and sent to the corresponing JMS destination. A JMS message sent to a JMS Destination is transformed into a JBI MessageExchange and sent to the corresponding JBI ServiceEndpoint.
{note}
* Only JMS TextMessage are recognized by the petals-binding-jms component.
* The service operation defined in the JBI MessageExchange is mapped to the operation String property of the JMS TextMessage (both in consumming and providing mode).
* If the JMS BC must use a JMS Provider other than Joram, this provider client libraries must be in the Petals classpath.
{note}
h1. Sending or publishing a JBI message to a JMS Queue or Topic
PROVIDE SERVICE: Expose a Java class as a Service

h2. Usage

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.

{note}
* All MessageExchange patterns are allowed. But, due to the JMS paradigm, all exchanges are processed like InOnly exchanges. For exemple, an InOut exchange returns a default message if JMS message is sent succesfully.
* The external Queue or Topic referenced by the Service Unit doesn't have to be available before you start the Service Unit. But the JNDI server where Queue or Topic are registered, must be available before you deploy the Service Unit.
* The NormalizedMessage properties are automaticaly converted as JMS message properties. Be careful, Weblogic doesn't allow "." character in JMS properties names.
{note}

h3. Service Unit descriptor
The Service Unit descriptor file ( jbi.xml ) looks like this :
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<jbi:jbi xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:petals="http://petals.objectweb.org/extensions"
xmlns:jbi="http://java.sun.com/xml/ns/jbi" version="1.0">
<jbi:services binding-component="false">
<jbi:provides interface-name="petals:JMSSampleProviderInterface"
service-name="petals:JMSSampleProviderService"
endpoint-name="JMSSampleProviderEndpoint">
<petals:params>
<petals:param name="address">scn://localhost:26400</petals:param>
<petals:param name="destination-name">queueProvider</petals:param>
<petals:param
name="initial-context-factory">fr.dyade.aaa.jndi2.client.NamingContextFactory</petals:param>
<petals:param name="connection-factory">qcf</petals:param>
<petals:param name="user">anonymous</petals:param>
<petals:param name="password">anonymous</petals:param>
<petals:param name="transacted">false</petals:param>
</petals:params>
</jbi:provides>
</jbi:services>
</jbi:jbi>
{code}
JMS communication attributes:

{center}{*}Service Unit attributes to provide services*{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} ||
| 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}

Extra attributes: {petalslink:author=llacote|type=FIXME marqué tel quel sans contenu dans le pdf}{petalslink}



{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}

{center}{*}Interceptors configuration in the Service Unit*{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} ||
| name | Name of the interceptor to use. That's the name defined in the component | \- | Yes |

{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. Component Configuration
The following attributes can be set during the installation phase to configure the component, using the params element of the jbi-install-component ANT task:
no configuration for this component (JBI).

{center}{*}Configuration of the component (CDK)*{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} ||
| pool-size | Number of threads listening to messages coming from the JBI container 0
(JBIListeners). \\
Int number >= 1 | 0 | No |
| ignored-status | When the component receives an acknowledgement message exchange, it can skip the processing of these message according to the type of the acknowledgment. If you decide to not ignore some acknowledgement, the component listeners must take care of them. \\
\\
Accepted values : DONE_AND_ERROR_IGNORED, DONE_IGNORED, ERROR_IGNORED or NOTHING_IGNORED | DONE_AND_ERROR_IGNORED | No |
| properties-file | Name of the file containing properties used as reference by other parameters. Parameters reference the property name in the following pattern $\{myPropertyName}. At runtime, the expression is replaced by the value of the property. \\
\\
The value of this parameter is :
* an URL
* a file relative to the PEtALS installation path
* an empty value to stipulate a non-using file | \- | No | Installation |
| external-listener-class-name | Qualified name of the class extending *AbstractExternalListener*
{note}Only for Binding Components{note} | \- | No | Component |
| jbi-listener-class-name | Qualified name of the class extending *AbstractJBIListener* | \- | Yes |
| external-listener-class-name | Qualified name of the class extending *AbstractExternalListener* | \- | No |
{table-plus}


{center}{*}Interceptors configuration in the component*{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} ||
| class | Name of the interceptor class. This class must extend the abstract class org.objectweb.petals.component.common.interceptor.Interceptor. This class have to be present in the classloader, in component or CF or in a shared library. | \- | Yes |
| name | Name of the interceptor. This name will be used for additional class name
configuration in the SU. | class name | No |
| active | Interceptor is active for all SU | true | No
{table-plus}