@ComponentProfile(summary="Receive messages from MSMQ using ActiveX", tag="consumer,msmq", recommended=MsmqConnection.class) public class MsmqPollingConsumer extends AdaptrisPollingConsumer implements com.adaptris.core.licensing.LicensedComponent
The AdaptrisConnection associated with MsmqPollingConsumer should be a MsmqConnection
. The MSMQ Message read from the
queue, should contains a String as the body (typically matching the Variant type VT_BSTR).
The string returned by the configured ConsumeDestination should be a MSMQ Queue name in the form
DIRECT=OS:.\private$\zzlc
or similar.
Possible formats for the Destination are (see the MSMQQueueInfo.FormatName documentation)
Note that this MSMQ implementation only supports MSMQ 3.0 and higher; This means Windows XP Professional, Windows Server 2003 and later operating systems.
Queue
In the adapter configuration file this class is aliased as msmq-polling-consumer which is the preferred alternative to the fully qualified classname when building your configuration.
License Required: ENTERPRISE
AdaptrisPollingConsumer.LockOperator
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
MsmqPollingConsumer()
Default Constructor.
|
MsmqPollingConsumer(ConsumeDestination d) |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyMapper(PropertyMapper p)
Add a property mapper to the list of configured property mappers.
|
java.lang.Boolean |
getAttemptSilentConversionToString() |
java.util.List<PropertyMapper> |
getPropertyMappers() |
TimeInterval |
getReceiveTimeout() |
MQOAConstants.ShareMode |
getShareMode() |
MQOAConstants.TransactionMode |
getTransactionMode() |
boolean |
isEnabled(com.adaptris.core.licensing.License license) |
protected void |
prepareConsumer() |
protected int |
processMessages() |
void |
setAttemptSilentConversionToString(java.lang.Boolean b)
Specify whether to silently attempt to conversion to String.
|
void |
setPropertyMappers(java.util.List<PropertyMapper> mappers)
Set the list of mappers to map into MSMQMessage fields.
|
void |
setReceiveTimeout(TimeInterval receiveTimeout)
Set the receive timeout.
|
void |
setShareMode(MQOAConstants.ShareMode s) |
void |
setTransactionMode(MQOAConstants.TransactionMode s)
Set the transaction mode.
|
void |
start() |
close, continueProcessingMessages, continueProcessingMessages, getMaxMessagesPerPoll, getPoller, getReacquireLockBetweenMessages, init, prepare, releaseLock, setMaxMessagesPerPoll, setPoller, setReacquireLockBetweenMessages, stop
changeState, getDestination, registerAdaptrisMessageListener, renameThread, requestClose, requestInit, requestStart, requestStop, retrieveAdaptrisMessageListener, retrieveComponentState, setDestination
createName, createQualifier, decode, encode, getEncoder, getIsConfirmation, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isConfirmation, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsConfirmation, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactory
getUniqueId
createName, createQualifier, isConfirmation, isTrackingEndpoint
public MsmqPollingConsumer()
Object.Object()
public MsmqPollingConsumer(ConsumeDestination d)
public TimeInterval getReceiveTimeout()
public void setReceiveTimeout(TimeInterval receiveTimeout)
As this is a polling consumer, a peek()
is used. The timeout directly determines how long this peek method waits
before returning
receiveTimeout
- the receive timout in MilliSeconds.protected void prepareConsumer() throws CoreException
prepareConsumer
in class AdaptrisPollingConsumer
CoreException
public boolean isEnabled(com.adaptris.core.licensing.License license)
isEnabled
in interface com.adaptris.core.licensing.LicensedComponent
public void start() throws CoreException
start
in interface ComponentLifecycle
start
in class AdaptrisPollingConsumer
CoreException
ComponentLifecycle.start()
protected int processMessages()
processMessages
in class AdaptrisPollingConsumer
AdaptrisPollingConsumer.processMessages()
public MQOAConstants.ShareMode getShareMode()
public void setShareMode(MQOAConstants.ShareMode s)
s
- the shareMode to setMQOAConstants.ShareMode
public java.util.List<PropertyMapper> getPropertyMappers()
public void setPropertyMappers(java.util.List<PropertyMapper> mappers)
mappers
- the mappers to setPropertyMapper
,
addPropertyMapper(PropertyMapper)
public void addPropertyMapper(PropertyMapper p)
p
- the property mapperpublic MQOAConstants.TransactionMode getTransactionMode()
public void setTransactionMode(MQOAConstants.TransactionMode s)
s
- the transactionMode to setMQOAConstants.TransactionMode
public java.lang.Boolean getAttemptSilentConversionToString()
public void setAttemptSilentConversionToString(java.lang.Boolean b)
When sending messages using COM components, the sending application does not indicate the type of information (string, array of bytes, numeric types, currency, date, or COM object) that is stored in the message body.
Where you do not have direct control over the sending application; it is possible for the sending application to be sending messages that are not considered Text (for the purposes of the Adapter, Strings equate to the internal Variant type of VT_BSTR). You may choose to use the built in best-guess conversion routines to attempt to convert the message payload into a String. Please be aware that this conversion is not always accurate, and you may not get the data that you expect.
b
- true to attempt conversion, default is false.Copyright Adaptris