activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bzaks1424 <bzaks1...@gmail.com>
Subject Camel + ActiveMQ + Spring Problems
Date Mon, 01 Mar 2010 21:06:41 GMT

I am writing an application using spring as my base, camel as my routing tool
and activemq as my transport. 

I wrote a listener to capture the message as it arrives into the Queue - and
process it right away.

Code:
@Service
public class PayloadQueueListener implements MessageListener {
	@Override
	public void onMessage(Message message) {
		try {
			ActiveMQBlobMessage blobMessage = (ActiveMQBlobMessage) message;

However - whenever I try to to do the cast - it throws a class cast
exception:
Exception:
org.apache.camel.RuntimeCamelException: java.lang.RuntimeException:
java.lang.ClassCastException: org.apache.activemq.command.ActiveMQMessage
cannot be cast to org.apache.activemq.command.ActiveMQBlobMessage
	at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
	at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:103)
	at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:543)
	at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:482)
	at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:451)
	at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:323)
	at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:261)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:982)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:974)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:876)
	at java.lang.Thread.run(Thread.java:619)

Do I need to do something specifically with ActiveMQ or is this an issue
with the way Camel is routing message and type casting it to the queue?
-- 
View this message in context: http://old.nabble.com/Camel-%2B-ActiveMQ-%2B-Spring-Problems-tp27749070p27749070.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message