Announcement Announcement Module
Collapse
No announcement yet.
exception in message listener Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • exception in message listener

    I use log4j for logging , anytime any exception happens in my web tier or services classes its always logged . I noticed if exception happens inside a message listener its not getting logged , what is the reason for this and how to fix this ?

  • #2
    You can try a couple of things:
    <jms:message-driven-channel-adapter channel="someChannel"
    extract-payload="true"
    acknowledge="transacted"
    container="yourMessageListenerContainer"
    error-channel="someErrorChannel" />

    You can then do whatever you like to log messages coming through the someErrorChannel.
    You can also create your container like this:
    <bean id="twlIncomingQueueMessageListenerContainer" class="yourpackage.TWLSimpleMessageListenerContain er">
    <property name="destination" ref="yourDestination" />
    <property name="concurrentConsumers" value="5" />
    <property name="connectionFactory" ref="yourConnectionFactory" />
    <property name="sessionTransacted" value="true" />
    <property name="errorHandler" ref="yourMessageListenerErrorHandler"/>
    </bean>

    You can log the errors in yourMessageListenerErrorHandler

    Comment

    Working...
    X