Hello everybody,
I have a problem with removing unused messages from ActiveMQ queue. The
problem is that when I peek messages which resides in ActiveMQ queue in
jconsole, I see that their JMSExpiration property is set to 0. But I wrote
my own jms provider marshaler which sets this property to my custom value.
The code looks like:

// marshaler

import javax.jbi.messaging.MessageExchange;
import javax.jbi.messaging.NormalizedMessage;
import javax.jms.Message;

import org.apache.servicemix.jms.endpoints.DefaultProviderMarshaler;

public class MyMarshaler extends DefaultProviderMarshaler {

    public void populateMessage(Message message, MessageExchange exchange,
NormalizedMessage normalizedMessage) throws Exception {
        super.populateMessage(message, exchange, normalizedMessage);
        message.setJMSExpiration(10000);
    }
}

// jms xbean.xml config

<jms:provider service="test:clientProviderService"
       endpoint="clientProviderEndpoint"
       destinationName="outClientQueue"
       marshaler="#myMarshaler"
       connectionFactory="#connectionFactory"/>

<bean id="myMarshaler" class="com.test.MyMarshaler" />



Despite of setting JMSExpiration property in custom marshaler, JMSExpiration
property is 0. Have you any idea what is wrong?

Reply via email to