@ComponentProfile(summary="Send messages to WebsphereMQ using the native client", tag="producer,websphere", recommended={AttachedConnection.class,DetachedConnection.class}) @Deprecated @ConfigDeprecated(removalVersion="4.0.0", message="IBM recommends using JMS instead", groups=java.lang.Deprecated.class) @Removal(version="4.0.0") public class NativeProducer extends ProduceOnlyProducerImp implements LicensedComponent
Depending on your WebsphereMQ configuration you will need to have installed and configured the WebsphereMQ Client software for your platform. The jars from the WebsphereMQ Client software should be copied into the adapter's lib directory.
If you configure FieldMappers, then by default the current date and time is inserted as the
putDateTime field (using MQC.MQOO_SET_ALL_CONTEXT means that all fields are undefined). This
value may be overridden by explicitly declaring a FieldMapper for the putDateTime field. In all
cases, DateFormatUtil.parse(String)
will be used to parse any
values to be used for putDateTime.
In the adapter configuration file this class is aliased as wmq-native-producer which is the preferred alternative to the fully qualified classname when building your configuration.
License Required: ENTERPRISE
log
Constructor and Description |
---|
NativeProducer()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addFieldMapper(FieldMapper p)
Deprecated.
Add a property mapper to the list of configured property mappers.
|
protected boolean |
checkOptions()
Deprecated.
|
protected void |
doProduce(AdaptrisMessage msg,
java.lang.String endpoint)
Deprecated.
|
java.lang.String |
endpoint(AdaptrisMessage msg)
Deprecated.
|
java.lang.Boolean |
getCheckOptions()
Deprecated.
|
ProduceDestination |
getDestination()
Deprecated.
|
java.util.List<FieldMapper> |
getFieldMappers()
Deprecated.
|
MessageOptions |
getOptions()
Deprecated.
|
java.lang.String |
getQueue()
Deprecated.
the native Websphere queue
|
void |
init()
Deprecated.
|
boolean |
isEnabled(License license)
Deprecated.
|
void |
prepare()
Deprecated.
|
void |
registerProxy(com.adaptris.core.wmq.ProducerDelegate delegate)
Deprecated.
This is used for testing purposes
|
com.adaptris.core.wmq.ProducerDelegate |
retrieveProxy()
Deprecated.
This is used for testing purposes
|
void |
setCheckOptions(java.lang.Boolean b)
Deprecated.
Specify whether or not to check the queue options and message options.
|
void |
setDestination(ProduceDestination destination)
Deprecated.
|
void |
setFieldMappers(java.util.List l)
Deprecated.
Set the list of properties to map into MQMessage fields.
|
void |
setOptions(MessageOptions options)
Deprecated.
|
void |
setQueue(java.lang.String queue)
Deprecated.
the native Websphere queue
|
produce, produce, request, request, request, request
createName
createQualifier, decode, encode, getEncoder, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory, withUniqueID
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactory
getUniqueId
close, start, stop
createQualifier, isTrackingEndpoint
public com.adaptris.core.wmq.ProducerDelegate retrieveProxy()
public void registerProxy(com.adaptris.core.wmq.ProducerDelegate delegate)
public final void prepare() throws CoreException
prepare
in interface ComponentLifecycleExtension
CoreException
public boolean isEnabled(License license)
isEnabled
in interface LicensedComponent
protected void doProduce(AdaptrisMessage msg, java.lang.String endpoint) throws ProduceException
doProduce
in class ProduceOnlyProducerImp
ProduceException
public void init() throws CoreException
init
in interface ComponentLifecycle
CoreException
public java.util.List<FieldMapper> getFieldMappers()
public void setFieldMappers(java.util.List l)
l
- the propertyMappers to setFieldMapper
,
addFieldMapper(FieldMapper)
public void addFieldMapper(FieldMapper p)
If any FieldMapper
s are configured, then the corresponding MQOO_SET_ALL_CONTEXT or MQOO_SET_IDENTITY_CONTEXT
should be set for MessageOptions.setQueueOpenOptions(String)
and MQPMO_SET_IDENTITY_CONTEXT or MQPMO_SET_ALL_CONTEXT
should be set for MessageOptions.setMessageOptions(String)
. If these flags are not set, then it is unlikely that any
field mapping that you do will be passed through to WebsphereMQ
p
- the property mapperMessageOptions.setMessageOptions(String)
,
MessageOptions.setQueueOpenOptions(String)
public MessageOptions getOptions()
public void setOptions(MessageOptions options)
options
- the options to setpublic java.lang.Boolean getCheckOptions()
public void setCheckOptions(java.lang.Boolean b)
If any FieldMapper
instances are configured, then the corresponding MQOO_SET_ALL_CONTEXT or MQOO_SET_IDENTITY_CONTEXT
generally needs to be set for MessageOptions.setQueueOpenOptions(String)
and MQPMO_SET_IDENTITY_CONTEXT or
MQPMO_SET_ALL_CONTEXT for MessageOptions.setMessageOptions(String)
. If these flags are not set, then we have found that
any field mapping that you do is not passed through to WebsphereMQ
If set to true, then if these options are not set, then they are added automatically.
b
- default is true, false to not check options.MessageOptions.setMessageOptions(String)
,
MessageOptions.setQueueOpenOptions(String)
protected boolean checkOptions()
public java.lang.String endpoint(AdaptrisMessage msg) throws ProduceException
endpoint
in class AdaptrisMessageProducerImp
ProduceException
@Deprecated public ProduceDestination getDestination()
@Deprecated public void setDestination(ProduceDestination destination)
public java.lang.String getQueue()
public void setQueue(java.lang.String queue)