public interface MessageReceiverInterceptor
Implementation of this interface can be activated programmatically specifying SupportedProperty.SOLACE_JMS_MESSAGE_CONSUMER_INTERCEPTOR_CLASS_NAME
using JMS environment properties
passed to InitialContext
or via JNDI Properties File with a key
"Solace_JMS_MessageConsumerInterceptorClassName". It is also possible to set it via a system property
"Solace_JMS_MessageConsumerInterceptorClassName".
Interceptor instantiation policy is "per instance of JMS connection".
Implementation of this interceptor require to have a public
default constructor, that
will be used for instantiation using reflection.
This interceptor can be used for cross cutting concerns like logging, validation, encryption etc..
Implementation of this interface needs to be on application classpath.
Modifier and Type | Interface and Description |
---|---|
static interface |
MessageReceiverInterceptor.ReceiverInterceptingContext
Represents a mutable intercepting context associated with a single act of message receive.
|
Modifier and Type | Method and Description |
---|---|
void |
onPreReceive(MessageReceiverInterceptor.ReceiverInterceptingContext interceptingContext)
This method is executed right after every inbound message is received and
before message is passed to the JMS application synchronously or asynchronously.
|
void onPreReceive(MessageReceiverInterceptor.ReceiverInterceptingContext interceptingContext) throws javax.jms.JMSException
Notes:
Calling Message.acknowledge()
in the method is not supported and is essentially a no-op.
After calling Message.clearProperties()
, the following Solace JMS message properties are
reset to their default values before the message is passed to the JMS application:
SupportedProperty.SOLACE_JMS_PROP_IS_REPLY_MESSAGE
SupportedProperty.SOLACE_JMS_PROP_DELIVER_TO_ONE
SupportedProperty.SOLACE_JMS_PROP_DEAD_MSG_QUEUE_ELIGIBLE
SupportedProperty.SOLACE_JMS_PROP_ELIDING_ELIGIBLE
SupportedProperty.SOLACE_JMS_PROP_ISXML
interceptingContext
- mutable intercepting context associated with a single receive of the
messagejavax.jms.JMSException
- can be thrown from the interceptor code to signal to the Solace JMS API
that the particular message should not be received. When interceptor
throws the exception it can have similar side effects as JMS API itself is
throwing same exception.Copyright 2004-2025 Solace Corporation. All rights reserved.