public class BasicMqSeriesImplementation extends VendorImplementationImp implements LicensedComponent
Basic IBM MQ Series implementation.
Depending on your WebsphereMQ configuration you will need at least the
com.ibm.mq.jar, com.ibm.mqjms.jar, connector.jar, dhbcore.jar and jta.jar
from your WebsphereMQ installation.
If you intend on using bindings mode, then you may need to include additional jars such as com.ibm.mqbind.jar
Note that if you require SSL support then you should use AdvancedMqSeriesImplementation
which allows greater flexibility
in configuration
WebsphereMQ requires you to set the transport type for your connection. Although the transport type is an integer, we have provided a string mapping to make configuration more readable. So your transport type should be set to one of the following (for reference we include the internal integer mapping);
Transport Type Value | Internal integer mapping |
---|---|
MQJMS_TP_BINDINGS_MQ | 0 |
MQJMS_TP_CLIENT_MQ_TCPIP | 1 |
MQJMS_TP_DIRECT_TCPIP | 2 |
MQJMS_TP_MQJD | 3 |
MQJMS_TP_DIRECT_HTTP | 4 |
By default, all JMS clients to MQ Series will create what is known as an MQRFH2 Header that will form part of the Websphere MQ
message. This is used to store (amongst other things) some of the JMS headers that you wanted to preserve using
MessageTypeTranslatorImp.setMoveJmsHeaders(Boolean)
, and all the custom JMS properties that you may
have chosen to preserve from AdaptrisMessage metadata by configuring
com.adaptris.core.jms.MessageTypeTranslatorImp#setMoveMetadata(Boolean)
to be true.This means that the message
format internally within WebpshereMQ is MQRFH2 and not MQSTR format. Accordingly the receiving application needs to be
able to parse MQRFH2 headers which may not be possible.
If the MQRFH2 Header/format is not required or you need to change the message type to MQSTR, then you need to tell MQSeries to
omit the MQRFH2 Header; this will mean that you'll lose all the JMS properties that are mapped into MQRFH2 as
standard by MQSeries and also any custom JMS Properties that you might be sending. To omit the MQRFH2 header, then you need
to add ?targetClient=1
after the queue name in your ProduceDestination
implementation. For
example, if the queue that you need to produce to is called SampleQ1 then the string you need to use is
queue:///SampleQ1?targetClient=1. More information about the mapping of JMS messages onto MQ Messages can be
found at this link
More generally speaking, the more powerful form of specifying a destination using uniform resource identifiers (URIs) is preferred. This form allows you to specify remote queues (queues on a queue manager other than the one to which you are connected). It also allows you to set the other properties contained in a com.ibm.mq.jms.MQQueue object. The URI for a queue begins with the sequence queue://, followed by the name of the queue manager on which the queue resides. This is followed by a further /, the name of the queue, and optionally, a list of name-value pairs that set the remaining Queue properties. For example: queue://Some_Other_Queue_Manager/SampleQ1?key1=value1&key2=value2. If you don't specify a queue manager in the URI then it is interpreted to be the queue manager to which you are currently connected to e.g. queue:///SampleQ1?key1=value1&key2=value2).
Various name value pairs can be used as part of the URI; these include, but is not limited to (some of these values may have a direct correlation to standard JMS headers, if you specify both, then behaviour is dependent on how WebsphereMQ JMS is configured)
Property | Description | Values |
---|---|---|
CCSID | Character set of the destination | integers - valid values listed in base WebSphere MQ documentation |
encoding | How to represent numeric fields | An integer value as described in the base WebSphere MQ documentation |
expiry | Lifetime of the message in milliseconds | 0 for unlimited, positive integers for timeout (ms) - This might interfere with any TTL value you configure in the producer. |
multicast | Sets multicast mode for direct connections | -1=ASCF, 0=DISABLED, 3=NOTR, 5=RELIABLE, 7=ENABLED |
persistence | Whether the message should be hardened to disk | 1=non-persistent, 2=persistent, -1=QDEF (use the queue definition) |
priority | Priority of the message | 0 through 9, -1=QDEF (use the queue definition)- This might interfere with any priority value you configure in the producer. |
targetClient | Whether the receiving application is JMS compliant | 0=JMS, 1=MQ |
In the adapter configuration file this class is aliased as basic-mq-series-implementation which is the preferred alternative to the fully qualified classname when building your configuration.
License Required: BASIC
log
Constructor and Description |
---|
BasicMqSeriesImplementation()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
connectionEquals(VendorImplementationBase comparable) |
javax.jms.ConnectionFactory |
createConnectionFactory() |
java.lang.String |
getBrokerHost() |
int |
getBrokerPort() |
java.lang.String |
getBrokerUrl()
Deprecated.
has never had any effect; simple included to avoid config break.
|
int |
getCcsid()
Returns ccsid.
|
java.lang.String |
getChannel()
Returns channel.
|
java.lang.String |
getQueueManager()
Returns queueManager.
|
java.lang.String |
getTemporaryModel()
Returns temporaryModel.
|
java.lang.String |
getTransportType()
Returns transportType.
|
boolean |
isEnabled(License license) |
void |
prepare() |
java.lang.String |
retrieveBrokerDetailsForLogging() |
void |
setBrokerHost(java.lang.String brokerHost) |
void |
setBrokerPort(int port) |
void |
setBrokerUrl(java.lang.String s)
Deprecated.
has never had any effect; simple included to avoid config break.
|
void |
setCcsid(int i)
Sets ccsid.
|
void |
setChannel(java.lang.String s)
Sets channel.
|
void |
setQueueManager(java.lang.String s)
Sets queueManager.
|
void |
setTemporaryModel(java.lang.String s)
Sets temporaryModel.
|
void |
setTransportType(java.lang.String i)
Sets transportType.
|
applyVendorSessionProperties, createConsumer, createDestination, createQueue, createQueueReceiver, createSession, createTopic, createTopicSubscriber
public BasicMqSeriesImplementation()
Creates a new instance.
public javax.jms.ConnectionFactory createConnectionFactory() throws javax.jms.JMSException
createConnectionFactory
in interface VendorImplementation
javax.jms.JMSException
public int getCcsid()
Returns ccsid.
public void setCcsid(int i)
Sets ccsid.
i
- the ccsid to setpublic java.lang.String getTransportType()
Returns transportType.
public void setTransportType(java.lang.String i)
Sets transportType.
i
- the transportType to setpublic java.lang.String getChannel()
Returns channel.
public void setChannel(java.lang.String s)
Sets channel.
s
- the channel to setpublic java.lang.String getQueueManager()
Returns queueManager.
public void setQueueManager(java.lang.String s)
Sets queueManager.
s
- the queueManager to setpublic java.lang.String getTemporaryModel()
Returns temporaryModel.
public void setTemporaryModel(java.lang.String s)
Sets temporaryModel.
s
- the temporaryModel to setpublic java.lang.String getBrokerHost()
public void setBrokerHost(java.lang.String brokerHost)
public int getBrokerPort()
public void setBrokerPort(int port)
public void prepare() throws CoreException
prepare
in interface ComponentLifecycleExtension
prepare
in class VendorImplementationImp
CoreException
public boolean isEnabled(License license)
isEnabled
in interface LicensedComponent
public boolean connectionEquals(VendorImplementationBase comparable)
connectionEquals
in interface ConnectionComparator<VendorImplementationBase>
public java.lang.String retrieveBrokerDetailsForLogging()
retrieveBrokerDetailsForLogging
in interface VendorImplementationBase
retrieveBrokerDetailsForLogging
in class VendorImplementationImp
@Deprecated public java.lang.String getBrokerUrl()
@Deprecated public void setBrokerUrl(java.lang.String s)