activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j0llyr0g3r <>
Subject Failed to send ..... to dead letter queue
Date Thu, 10 Apr 2008 09:42:32 GMT

Hey folks,

i really hope someone can help me out, since i am running out of ideas....

My problem seems quite simple:

-> I have a self-written message producer using AMQ-libraries
-> I have a self-written message consumer using AMQ-libraries
-> And a (single) AMQ-Broker in the middle
-> All used AMQ-libraries have the some version (version 5, downloaded one
week ago)
-> consumer and producer use "real" tcp-connections, _not_
"in-jvm"-connections, even when they are running on the same machine

Now, if all of the three components (producer + broker + consumer) run on
the same host, everything works _fine_....

The problem:

If all 3 components run on different hosts, nothing happens, meaning:

-> My producer "hangs":

INFO (SendSyncCmd.send) 2008-04-08 11:18:11,085
Sending message..... 
INFO (SendSyncCmd.send) 2008-04-08 11:18:11,090
Waiting for reponse message...

My producer sends to the queue: 

Publishing a Message with size 255 to queue: CMD.ESF-PROTO-2

-> My consumer prints nothing out, i.e. receives nothing.

But he listens on right queue: CMD.ESF-PROTO-2

-> Now to the interesting part: The broker.

If i take a look at the web-interface i see something like:

Name   	Number Of Pending Messages   	Number Of Consumers  

CMD.ESF-PROTO-2 	-1 	1

Number Of Pending Messages = -1? What is this supposed to mean?

If i look at the command-line output of the broker i see:

WARN  RegionBroker                   - Failed to send ActiveMQBytesMessage
{commandId = 7, responseRequired = false, messageId =,
originalDestination = null, originalTransactionId = null, producerId =, destination =
queue://CMD.ESF-PROTO-2, transactionId = null, expiration = 1207822630933,
timestamp = 1207822630678, arrival = 0, brokerInTime = 1209266957622,
brokerOutTime = 0, correlationId = null, replyTo =
persistent = false, type = null, priority = 4, groupID = null, groupSequence
= 0, targetConsumerId = null, compressed = false, userID = null, content =
org.apache.activemq.util.ByteSequence@ee3dee, marshalledProperties = null,
dataStructure = null, redeliveryCounter = 0, size = 0, properties = null,
readOnlyProperties = false, readOnlyBody = false, droppable = false}
ActiveMQBytesMessage{ bytesOut = null, dataOut = null, dataIn = null } to
dead letter queue

So, in a nutshell, the broker tells me:

Failed to send ActiveMQBytesMessage dead letter queue

But tells in the same output:

destination = queue://CMD.ESF-PROTO-2

which is correct! This queue exists and i got a consumer listening!

Now, if i look in the source-code of activemq, there is only one location
where this message is generated:

-> package;
-> Class  RegionBroker
-> Method  sendToDeadLetterQueue()

    public void sendToDeadLetterQueue(ConnectionContext context,
	        MessageReference node){
			boolean sent=false;
				Message message=node.getMessage();
					DeadLetterStrategy deadLetterStrategy=node
							long expiration=message.getExpiration();
							message.setProperty("originalExpiration",new Long(
							// The original destination and transaction id do
							// not get filled when the message is first
							// sent,
							// it is only populated if the message is routed to
							// another destination like the DLQ
							ActiveMQDestination deadLetterDestination=deadLetterStrategy
							if (context.getBroker()==null) {
				LOG.warn("Failed to send "+node+" to dead letter queue");
		}catch(Exception e){
			LOG.warn("Failed to pass expired message to dead letter queue",e);

To be more specific, the last "if":

				LOG.warn("Failed to send "+node+" to dead letter queue");

Unfortunately, there is neither a java-doc nor a possibility to increase the
logging-output, so i am clueless why "sent=false" is true.

If you look at the source-code above, there are four possibilites:

node=null || message=null || node.getRegionDestination()=null ||

And that's where i am stuck....

I would really appreciate it, if some of you guys could help me out......
View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message