The JMS WSDL extensibility elements allow the user to "define" JMS protocol based bindings in a WSDL.
This page describes the JMS extensibility elements for address, binding, operation, input, and output.
How to read the tables:
Each table describes the attribute(s) for a particular JMS extensibility element and any children elements the extensiblity element may have. For each attribute or element, its name, description, whether the attribute or element applies to both provider or consumer (Common), whether the attribute or element applies only to provider (Provider Only), whether the attribute or element applies only to consumer (Consumer Only), whether it is required, and an example of its usage are provided. Note that provider or consumer is from the perspective of the JMS Binding Component with respect to other components in the JBI environment. If other components "consume" the service(s) of the JMS Binding Component, then the JMS Binding Component is a provider. On the other hand, if the JMS Binding Component "consumes" the services of ther JBI components, then the JMS Binding Component is a consumer.
An additional column called Can Be Env specifies whether an environment variable can be used in place of a value. A token starts with ${ and ends with }. For example, for the connectionURL attribute, one can use an environment variable token such as ${tok_connectionURL}. The value of this environment variable (tok_connectionURL) can then be set using the JMS BC runtime configuration MBean (i.e., via NetBeans).
JMS address element attributes:
| Attribute/Element Name | Description | Common | Provider Only | Consumer Only | Required | Can Be Env | Example |
|---|---|---|---|---|---|---|---|
| connectionURL | A URL which specifies the connectivity information to connect to the JMS server, even if that JMS server normally doesn't use a URL format | X | X | X | mq://myhost:7676 | ||
| username | Specifies the username used for connecting to the JMS server | X | X | guest | |||
| password | Specifies the password used for connecting to the JMS server | X | X | guest | |||
| connectionFactoryName | When the connectionURL attribute of the address extensibility element is specified as "jndi://", this attribute defines the JMS connection factory JNDI name used to lookup the JMS connection factory for creating connections. Note that the destinationType and transaction attributes determine what type of JMS connection factory is being looked up. For example, if destinationType is Queue and transaction is XATransaction then the JMS connection factory must be of type javax.jms.XAQueueConnectionFactory. | X | X | MyQueueCF | |||
| initialContextFactory | When the connectionURL attribute of the address extensibility element is specified as "jndi://", this attribute defines the initial context factory to use; see javax.naming.Context.INITIAL_CONTEXT_FACTORY | X | com.sun.jndi.fscontext.RefFSContextFactory | ||||
| providerURL | When the connectionURL attribute of the address extensibility element is specified as "jndi://", this attribute defines the configuration information for the service provider to use; see javax.naming.Context.PROVIDER_URL | X | X | file:///C:/temp/JavaMQFactoriesObjFile | |||
| securityPrincipal | When the connectionURL attribute of the address extensibility element is specified as "jndi://", this attribute defines the identity of the principal for authenticating the caller to the service; see javax.naming.Context.SECURITY_PRINCIPAL | X | X | SomeUser | |||
| securityCredentials | When the connectionURL attribute of the address extensibility element is specified as "jndi://", this attribute defines the credentials of the principal for authenticating the caller to the service; see javax.naming.Context.SECURITY_CREDENTIALS | X | X | SomePass | |||
| jndienv | Child element of the address element which allows for specifying additional provider specific JNDI environment properties used to create the javax.naming.InitialContext. This is used only when the JMS BC is used in JNDI lookup mode where by it looks up the JMS connection factory needed to create connections | X | -- |
The following is a sample usage of the JMS address extensiblity element defined for a service port which contains a connectionURL that specifies an explicit JMS provider,
<port binding="y:binding" name="jmsOutOnlyTestEndpoint">
<jms:address connectionURL="mq://localhost:7676" username="admin" password="admin"/>
</port>
Here's another sample usage of the JMS address extensiblity element defined for a service port which contains a connectionURL that specifies a JNDI URL,
<port binding="y:binding" name="jmsOutOnlyTestEndpoint">
<jms:address connectionURL="jndi://"
connectionFactoryName="MyXAQueueCF"
initialContextFactory="com.sun.jndi.fscontext.RefFSContextFactory"
providerURL="file:///C:/temp/JavaMQFactoriesObjFile">
<jms:jndienv>
...
</jms:jndienv>
</jms:address>
</port>
This example shows that the jndiConnectionFactoryName is "MyXATopicCF". Assuming that the JMS binding operation's destinationType value is "Queue" and that the Transaction value is "XATransaction", then the connection factory type being looked up is of type javax.jms.XAQueueConnectionFactory. It is the responsibility of the user to ensure that the connection factory bound to JNDI as "MyXAQueueCF" is of type javax.jms.XAQueueConnectionFactory. When JNDI is used, additional information needed to create the javax.naming.InitialContext must be specified by using the jndienv extensibility element. See additional details below on how to use the jndienv extensibility element to configure the JNDI environment information.
The connectionURL specifies the connectivity information to connect to the JMS server, even if that JMS server normally doesn't use a URL format. The format is of the form
protocol://server:port?key1=value1&key2=value2
The query string is optional and is reserved for possible future use. It contains both properties for the JMS server as well as for the JMSJCA connector used by the JMS Binding Component.
The protocol portion of the connectionURL can specify either a particular JMS provider (i.e., "mq" for Sun Java System Message Queue aka Java MQ) or a generic JMS provider, via JNDI, by using "jndi" as the prefix. In the case when JNDI is used to look up a JMS connection factory, the connectionURL is simply specified as "jndi://". The jndienv extensibility element is then used to specified the JNDI environment context in order for the JMS BC to create the javax.naming.InitialContext. See the section on the jndienv extensibility element below for details. Please note that when JNDI is used, the appropriate JNDI provider jar(s) must be in the runtime classpath (e.g., for Sun Application Server (Glassfish), the JNDI provider jar(s) can be copied to the the lib directory. In addition, JMS provider client jars also need to be in the runtime classpath.
This table lists the protocol and the corresponding JMS provider
| URL Starts With | Provider | Example |
|---|---|---|
| mq:// | Sun Java MQ | mq://localhost:7676 |
| jndi:// | Generic JMS Provider | jndi:// |
<port binding="y:binding" name="jmsOutOnlyTestEndpoint">
<jms:address connectionURL="mq://localhost:9090,mq://localhost:9191,mq://localhost:9292" username="admin" password="admin"/>
</port>
See the Sun Java System MQ documentation on how to create a cluster of brokers.
JMS jndienventry element attributes: The JMS jndienventry element is used to specify the name and value of a JNDI environment map entry. The name and value of each entry depends on the JNDI provider being used.
| Attribute Name | Description | Required | Example |
|---|---|---|---|
| name | The name of the JNDI environment map entry | X | java.naming.factory.initial |
| value | The value of the JNDI environment map entry | X | com.sun.jndi.fscontext.RefFSContextFactory |
<port binding="y:binding" name="jmsOutOnlyTestEndpoint">
<jms:address connectionURL="jndi://"
connectionFactoryName="SampleQCF"
initialContextFactory="com.sonicsw.jndi.mfcontext.MFContextFactory"
providerURL="tcp://localhost:2506">
<jms:jndienv>
<jms:jndienventry name="com.sonicsw.jndi.mfcontext.domain" value="Domain1"/>
<jms:jndienventry name="com.sonicsw.jndi.mfcontext.idleTimeout" value="60000"/>
<jms:jndienv>
</jms:address>
</port>
The following is a sample usage of the JMS binding extensiblity element,
<binding name="bindingJMSOneWayOut"
type="tns:portTypeOneWayOut">
<jms:binding></jms:binding>
...
</binding>
JMS operation element attributes and children elements:
| Attribute/Element Name | Description | Common | Provider Only | Consumer Only | Required | Can Be Env | Example | |
|---|---|---|---|---|---|---|---|---|
| destination | Defines the destination where messages are sent or received | X | X | X | InvoiceQueue | |||
| destinationType | Specifies the destination type, either Queue or Topic | X | X | Queue | ||||
| transaction | Defines the transaction type for the JMS protocol based operation; valid values: NoTransaction, XATransaction | X | NoTransaction | |||||
| deliveryMode | The message delivery mode to use when sending a message, either NON_PERSISTENT or PERSISTENT; default is NON_PERSISTENT | X | NON_PERSISTENT | |||||
| timeToLive | Time in milliseconds from its dispatch time that a produced message, from the message producer, should be retained by the message system | X | 120000 | |||||
| priority | The message priority for a message producer; must be a value between 0 and 9; 0 is lowest, 9 is highest; default is 4 | X | 4 | |||||
| disableMessageID | Sets whether message IDs are disabled for a message producer, either true or false; default is false | X | false | |||||
| disableMessageTimeStamp | Sets whether message timestamps are disabled for a message producer, either true or false; default is false | X | false | |||||
| timeout | Sets the timeout in milliecons on a message consumer receive for a reply message; applies only to provider request reply | X | 120000 | |||||
| clientID | A unique client ID; if using a durable subscriber and this is not set then the durableName will be used as the clientID | X | X | ClientID123 | ||||
| messageSelector | JMS message selector to define message filtering | X | X | JMSCorrelationID='88888888' AND JMSType='SUN' | ||||
| validateMessageSelector | If messageSelector is used, this enables or disables the validation of the message selector syntax during deployment. Default is true if not specified. | X | true | |||||
| subscriptionDurability | Determines the durability of the Topic subscriber, either NonDurable or Durable, default is NonDurable | X | NonDurable | |||||
| subscriptionName | The name used to denote the durable subscription; used only if using a durable subscriber (destination is a Topic and subscriptionDurability is set to Durable) | X | X | SunStockSubscriptionName | ||||
| batchSize | If defined with a positive integer, this element specifies that the messages received will be in a batch. The number of messages in the batch could be less than or equal to the specified size | X | 20 | |||||
| maxConcurrentConsumers | If defined with a positive integer and the destination type is Queue, this element specifies the maximum number of concurrent receivers that can process messages; default is 15 if destinationType is Queue | X | 15 | |||||
| redeliveryHandling | If defined, this attribute specifies what actions to take in the event that an error occurred in processing the JMS message received from the JMS destination (for example, putting the "poisoned" message in a dead letter queue). See below for syntax of redeliveryHandling | X | X | 5:1000; 10:5000; 50:move(queue:mydlq) | ||||
| options | This a sub-element reserved for future use to define additional configuration options | X | -- |
The following shows the operation extensibility element in a JMS binding using an explicit JMS provider (i.e., connectionURL is "mq://localhost:7676" to use Java MQ):
...
<port binding="y:binding" name="jmsOutOnlyTestEndpoint">
<jms:address connectionURL="mq://localhost:7676"/>
...
<operation name="Operation1">
<jms:operation destination="MyTopic"
destinationType="Topic"
messageSelector="JMSType='FOO.Type'"/>
...
</operation>
...
Specification of what actions to undertake when the message is repeatedly redelivered is done through a specially formatted string. The string has this format:
format := entry[; entry]*
entry := idx ":" action
idx := number (denotes the n-th time a msg was seen)
action := number (denotes delay in ms) | "delete" | "move"(args)
move := "queue"|"topic" | "same" ":" destname
destname := any string, may include "$" which will be replaced with the original
destination name.
Here are some examples.
Example:
5:1000; 10:5000; 50:move(queue:mydlq)
This causes no delay up to the 5th delivery; a 1000 ms delay is invoked when the message is seen the 5th, 6th, 7th, 8th, and 9th time. A 5 second delay is invoked when the msg is invoked the 10th, 11th, ..., 49th time. When the msg is seen the 50th time the msg is moved to a queue with the name "mydlq".
If the messages were received from "Queue1" and if the string was specified as
5:1000; 10:5000; 50:move(queue:dlq$oops)
the messages would be moved to the destination "dlqQueue1oops": the special character "$" denotes the original destination name. Instead of "queue" one can also specify "topic" or "same". The latter denotes a queue if the message was received from a queue, or can denote a topic if the message was received from a topic.
Another example:
5:1000; 10:5000
This causes no delay up to the 5th delivery; a 1000 ms delay is invoked when the message is seen the 5th, 6th, 7th, 8th, and 9th time. A 5 second delay is invoked for each time the message is seen thereafter.
JMS message element attributes and children elements:
| Attribute/Element Name | Description | Common | Provider Only | Consumer Only | Required | Example |
|---|---|---|---|---|---|---|
| properties | This sub-element defines the JMS message user properties to/from WSDL Message part(s) mappings; see the table for properties below for details | X | -- | |||
| mapmessage | This child element defines the JMS MapMessage to/from WSDL Message part(s) mappings; see the table for mapmessage for details | X | Required if messageType is MapMessage, no otherwise | -- | ||
| messageType | The type of JMS messages to be created and sent to the JMS destination; valid values: MapMessage, TextMessage | X | X | TextMessage | ||
| textPart | When messageType is TextMessage, this attribute defines the WSDL message part to/from JMS TextMessage text payload mapping | X | Required if messageType is TextMessage, no otherwise | msgPart1 | ||
| use | Specify encoder support; valid values: literal, encoded | X | X | TextMessage | ||
| encodingStyle | Specify the encoder used if use is set to encoded | X | Required if use is encoded | TextMessage | ||
| correlationIdPart | This attribute is used to reference the message part where the JMSCorrelationID header value will be retrieved or stored | X | partCorrelationID | |||
| deliveryModePart | This attribute is used to reference the message part where the JMSDeliveryMode header value will be retrieved or stored | X | partDeliveryMode | |||
| priorityPart | This attribute is used to reference the message part where the JMSPriority header value will be retrieved or stored | X | partPriority | |||
| typePart | This attribute is used to reference the message part where the JMSType header value will be retrieved or stored | X | partType | |||
| messageIDPart | This attribute is used to reference the message part where the JMSMessageID header value will be stored | X | partMessageID | |||
| redeliveredPart | This attribute is used to reference the message part where the JMSRedelivered header value will be stored | X | partRedelivered | |||
| timestampPart | This attribute is used to reference the message part where the JMSTimestamp header value will be stored | X | partTimestamp |
The following shows the message extensibility element in a JMS binding:
...
<jms:binding></jms:binding>
<operation name="operationOneWayOut">
<jms:operation destination="MyTopic"
destinationType="Topic"
messageSelector="JMSType='FOO.Type'"/>
<input name="input">
<!—jms:message defines the wsdl message to/from jms message mappings -->
<jms:message messageType="MapMessage"
use="literal"
correlationIdPart=”msgPart1”
deliveryModePart=”msgPart2”
priorityPart=”msgPart3”
typePart=”msgPart4”
messageIDPart=”msgPart5”
timestampPart=”msgPart6”>
<jms:mapmessage>
<jms:mappart part="partBoolean" type="boolean" name="BooleanMapEntry"></jms:mappart>
<jms:mappart part="partChar" type="char" name="CharMapEntry"></jms:mappart>
</jms:mapmessage >
</jms:message>
</input>
</jms:operation>
</operation>
</jms:binding>
...
JMS property element attributes:
| Attribute Name | Description | Required | Example |
|---|---|---|---|
| name | The name of the JMS property to which the message part is mapped | X | JMSProp1 |
| part | The name of the message part to which the JMS property is mapped | X | msgPart1 |
| propertyType | The type of the JMS property, one of boolean,short,int,long,float,double, or string | X | string |
The following is a sample usage of the JMS properties and property extensiblity elements,
...
<jms:message messageType="TextMessage" textPart="partBody">
<jms:properties>
<jms:property part="partPropString" propertyType="string" name="AppStringProperty"></jms:property>
<jms:property part="partPropBoolean" propertyType="boolean" name="AppBooleanProperty"></jms:property>
<jms:property part="partPropShort" propertyType="short" name="AppShortProperty"></jms:property>
<jms:property part="partPropInt" propertyType="int" name="AppIntProperty"></jms:property>
<jms:property part="partPropLong" propertyType="long" name="AppLongProperty"></jms:property>
<jms:property part="partPropFloat" propertyType="float" name="AppFloatProperty"></jms:property>
</jms:properties>
</jms:message>
...
JMS mappart element attributes:
| Attribute Name | Description | Required | Example |
|---|---|---|---|
| name | The name of the MapMessage object to which the message part is mapped | X | JMSProp1 |
| part | The name of the message part to which the MapMessage object is mapped | X | msgPart1 |
| type | The Java type of the JMS MapMessage object | X | string |
The following is a sample usage of the JMS mapmessage and mappart extensiblity elements,
...
<jms:message messageType="MapMessage">
<jms:mapmessage>
<jms:mappart part="partBoolean" type="boolean" name="BooleanMapEntry"></jms:mappart>
<jms:mappart part="partChar" type="char" name="CharMapEntry"></jms:mappart>
<jms:mappart part="partDouble" type="double" name="DoubleMapEntry"></jms:mappart>
<jms:mappart part="partFloat" type="float" name="FloatMapEntry"></jms:mappart>
<jms:mappart part="partInt" type="int" name="IntMapEntry"></jms:mappart>
<jms:mappart part="partLong" type="long" name="LongMapEntry"></jms:mappart>
<jms:mappart part="partShort" type="short" name="ShortMapEntry"></jms:mappart>
<jms:mappart part="partString" type="string" name="StringMapEntry"></jms:mappart>
</jms:mapmessage>
</jms:message>
...
JMS option element attributes:
| Attribute Name | Description | Required | Example |
|---|---|---|---|
| name | The name of the JMSJCA option | X | -- |
| value | The valueof the JMSJCA option | X | -- |
Table of JMSJCA RA options currently supported by the JMS BC:
| Option Name | Description | Option Value Type | Example |
|---|---|---|---|
| JMSJCA.poolmaxsize | The maximum number of connections in the pool (32 is default if not specified) | integer | 35 |
| JMSJCA.poolminsize | The minimum number of connections in the pool (0 is default if not specified) | integer | 5 |
| JMSJCA.pooltimeout | When the application requests a connection and the number of in-use connections has reached the poolmaxsize, this is the maximum time in milliseconds the pool will block before it will throw an exception back to the application. A value of zero will wait indefinitely until a connection becomes available. A negative value will throw an exception immediately. A positive value will throw an exception after the specified value. Default is to throw an exception if a connection is not available (-1) | long | 60000 |
The following is a sample usage of the JMS options and option extensiblity elements,
...
<jms:operation destination="InTestDestination2"
destinationType="Queue"
transaction="NoTransaction">
<jms:options>
<jms:option name="JMSJCA.poolmaxsize" value="35"/>
<jms:option name="JMSJCA.pooltimeout" value="30000"/>
</jms:options>
</jms:operation>
</jms:operation>
...
*SonicMQ® is a product and a registered trademark of Progress Software Corporation ©, http://www.sonicsoftware.com/products/sonicmq/index.ssp
Access Count: 6
StatCounter Access Count :