Announcement Announcement Module
Collapse
No announcement yet.
Spring JMS - JBOSS 6.1.0 HornetQ Queue Integration Issue. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring JMS - JBOSS 6.1.0 HornetQ Queue Integration Issue.

    Hello Friends,

    I am facing one issue in consuming the Hornet Q queue messages in JBOSS 6.1.0 AS using Spring JMS Template.
    I have configured the Queue and Connection factory as below in hornetq-jms.xml

    <connection-factory name="MyConnectionFactory">
    <connectors>
    <connector-ref connector-name="in-vm"/>
    <connector-ref connector-name="netty"/> <!--Added for hornetq monitoring-->
    </connectors>
    <entries>
    <entry name="java:jms/MyConnectionFactory"/>
    <entry name="java:jms/MyXAConnectionFactory"/>
    </entries>
    </connection-factory>

    <queue name="myQueueOne">
    <entry name="java:jms/queue/myQueueOne"/>
    <durable>true</durable>
    </queue>


    Below is the Spring Configuration for Jndi Lookup and Jms template Configuration

    <jee:jndi-lookup id="connectionFactory" jndi-name="java:jms/MyConnectionFactory" resource-ref="true"
    expected-type="javax.jms.ConnectionFactory" lookup-on-startup="false" />
    <jee:jndi-lookup id="myQueueOne" jndi-name="java:jms/queue/myQueueOne" resource-ref="true"
    expected-type="javax.jms.Queue" lookup-on-startup="false" />


    <bean id="queueOneTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory" ref="connectionFactory" />
    <property name="defaultDestination" ref="myQueueOne" />
    <property name="pubSubDomain" value="false" />
    <property name="receiveTimeout" value="1000" />
    </bean>

    <bean id="queueOneListener"
    class="com.test.queueConsumer.MyQueueOneListener">
    <property name="eventNotificationDAO" ref="eventNotificationDAO" />
    <property name="atsServiceCallSupport" ref="atsServiceCallSupport" />
    </bean>

    <bean id="queueOneContainer" class="org.springframework.jms.listener.DefaultMes sageListenerContainer">
    <property name="taskExecutor" ref="mdpPoolTaskExecutor" />
    <property name="connectionFactory" ref="connectionFactory" />
    <property name="messageListener" ref="queueOneListener" />
    <property name="destination" ref="myQueueOne" />
    <property name="concurrentConsumers" value="5" />
    <property name="maxConcurrentConsumers" value="50" />
    <property name="pubSubDomain" value="false" />
    <property name="cacheLevelName" value="CACHE_CONSUMER" />
    <property name="idleTaskExecutionLimit" value="100" />
    <property name="sessionTransacted" value="true" />
    <property name="autoStartup" value="true" />
    </bean>

    <bean id="mdpPoolTaskExecutor"
    class="org.springframework.scheduling.concurrent.T hreadPoolTaskExecutor">
    <property name="corePoolSize" value="5" />
    <property name="maxPoolSize" value="50" />
    <property name="queueCapacity" value="250" />
    <property name="threadNamePrefix" value="MDP-WorkerThread" />
    </bean>


    Now when i populate the Queue with some messages, while the Listner code executes(message drains) i am getting the below Error.


    13:34:45,067 ERROR [STDERR] org.springframework.jms.InvalidDestinationExceptio n: Not a HornetQ Destination:HornetQQueue[myQueueOne]; nested exception is javax.jms.InvalidDestinationException: Not a HornetQ Destination:HornetQQueue[myQueueOne]
    13:34:45,069 ERROR [STDERR] at org.springframework.jms.support.JmsUtils.convertJm sAccessException(JmsUtils.java:285)
    13:34:45,069 ERROR [STDERR] at org.springframework.jms.support.JmsAccessor.conver tJmsAccessException(JmsAccessor.java:168)
    13:34:45,069 ERROR [STDERR] at org.springframework.jms.core.JmsTemplate.execute(J msTemplate.java:469)
    13:34:45,069 ERROR [STDERR] at org.springframework.jms.core.JmsTemplate.send(JmsT emplate.java:534)
    13:34:45,069 ERROR [STDERR] at org.springframework.jms.core.JmsTemplate.send(JmsT emplate.java:526)
    13:34:45,069 ERROR [STDERR] at com.apple.ist.hr.merlin.rsvp.jms.queueProducer.MyM essageSender.pushToQueueOne(MyMessageSender.java:3 5)
    13:34:45,069 ERROR [STDERR] at com.apple.ist.hr.merlin.rsvp.jms.queueProducer.MyM essageSender$$FastClassByCGLIB$$610be92c.invoke(<g enerated>)
    13:34:45,069 ERROR [STDERR] at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy. java:149)
    13:34:45,070 ERROR [STDERR] at org.springframework.aop.framework.Cglib2AopProxy$C glibMethodInvocation.invokeJoinpoint(Cglib2AopProx y.java:688)
    13:34:45,070 ERROR [STDERR] at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :150)
    13:34:45,070 ERROR [STDERR] at org.springframework.aop.aspectj.MethodInvocationPr oceedingJoinPoint.proceed(MethodInvocationProceedi ngJoinPoint.java:80)
    13:34:45,070 ERROR [STDERR] at com.apple.ist.hr.merlin.rsvp.common.logging.Logger Aspect.proceedAndlogMessage(LoggerAspect.java:265)
    13:34:45,070 ERROR [STDERR] at com.apple.ist.hr.merlin.rsvp.common.logging.Logger Aspect.profile(LoggerAspect.java:152)
    13:34:45,070 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor341.invoke(Unkn own Source)
    13:34:45,070 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    13:34:45,070 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
    13:34:45,071 ERROR [STDERR] at org.springframework.aop.aspectj.AbstractAspectJAdv ice.invokeAdviceMethodWithGivenArgs(AbstractAspect JAdvice.java:621)
    13:34:45,071 ERROR [STDERR] at org.springframework.aop.aspectj.AbstractAspectJAdv ice.invokeAdviceMethod(AbstractAspectJAdvice.java: 610)
    13:34:45,071 ERROR [STDERR] at org.springframework.aop.aspectj.AspectJAroundAdvic e.invoke(AspectJAroundAdvice.java:65)
    13:34:45,071 ERROR [STDERR] at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)



    I am not able to figure out if i have to mention in Jndi look up expected-type="javax.jms.Queue" as HornetQ type of Queue.



    Could some help me out to fix this issue. or let me know the work around.

    Any help in this regard will be heartily appreciated.


    Thanks in Advance,
    Pradeep Alabe

  • #2
    perhaps this may help https://community.jboss.org/thread/169866?tstart=0

    Comment

    Working...
    X