The test ensure it works:

@Test
public void testInOnlyJMSExpiration() throws Exception {
    MockEndpoint mock = getMockEndpoint("mock:result");
    mock.expectedMessageCount(1);

    long ttl = System.currentTimeMillis() + 5000;

template.sendBodyAndHeader("activemq:queue:bar?preserveMessageQos=true",
"Hello World", "JMSExpiration", ttl);

    // sleep just a little
    Thread.sleep(2000);

    // use timeout in case running on slow box
    Exchange bar = consumer.receive("activemq:queue:bar", 10000);
    assertNotNull("Should be a message on queue", bar);

    template.send("activemq:queue:foo", bar);

    assertMockEndpointsSatisfied();
}

@Test
public void testInOnlyJMSExpirationNoMessage() throws Exception {
    MockEndpoint mock = getMockEndpoint("mock:result");
    mock.expectedMessageCount(1);

    long ttl = System.currentTimeMillis() + 2000;

template.sendBodyAndHeader("activemq:queue:bar?preserveMessageQos=true",
"Hello World", "JMSExpiration", ttl);

    // sleep more so the message is expired
    Thread.sleep(5000);

    Exchange bar = consumer.receiveNoWait("activemq:queue:bar");
    assertNull("Should NOT be a message on queue", bar);

    template.sendBody("activemq:queue:foo", "Hello World");

    assertMockEndpointsSatisfied();
}

protected RouteBuilder createRouteBuilder() throws Exception {
    return new RouteBuilder() {
        public void configure() throws Exception {
            from("activemq:queue:foo")
                .to("mock:result");
        }
    };
}

Check what you do differently...

Best,
Christian
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Wed, Jul 24, 2013 at 4:42 PM, prabumc...@gmail.com
<prabumc...@gmail.com>wrote:

> Hi Chris,
>
>  Thanks so much for the information.
>
> I have tried different property but it did not work.
>
> Please find my code below.
>
> *public static final String CONSUMER_TEST_QNAME     =
>
> "activemq:queue:ConsumerTestHandler?jmsMessageType=Text&preserveMessageQos=true";
> *
> *
> *
> *public static final String PRODUCER_TEST_QNAME     =
>
> "activemq:queue:ProducerTestHandler?jmsMessageType=Text&preserveMessageQos=true";
> *
> *    *
> *public static final String MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME  =
> "activemq:queue:Inbound.Memos.Consumer.Test";*
> *
> *
> *public static final String MESSAGING_TEST_PRODUCER_TYPE_SPECIFIC_QNAME  =
> "activemq:queue:Inbound.Memos.Producer.Test";*
>
>
> from(*MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME*).process(new Processor()
> {
>      public void process(Exchange exchange) throws Exception {
>
>      }
>          .setHeader(MEMOS_TARGET_SERVER,header(MASTER_HANDLER))
>          .setHeader(JMSExpiration,constant(EXPIRY_TIME))
>          .to(CONSUMER_TEST_QNAME)
>          .setHeader(MEMOS_TARGET_SERVER, header(SLAVE_HANDLER))
>          .setHeader(JMSExpiration,constant(EXPIRY_TIME))
>          .to(CONSUMER_TEST_QNAME)
>          .end();
>
> But,messages not expiring
>
> Please kindly help me
>
> *Thanks*
> Prabu.N
>
>
> On Wed, Jul 24, 2013 at 1:46 AM, Christian Mueller [via Camel] <
> ml-node+s465427n5736163...@n5.nabble.com> wrote:
>
> > It's not really so difficult to find an example, if you spend only a few
> > minutes:
> >
> >
> https://git-wip-us.apache.org/repos/asf?p=camel.git;a=blob;f=components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsProducerWithJMSHeaderTest.java;h=52b430b17a7ffc0ca977864ea8c6238050f90a57;hb=HEAD
> >
> > Best,
> > Christian
> > -----------------
> >
> > Software Integration Specialist
> >
> > Apache Camel committer: https://camel.apache.org/team
> > V.P. Apache Camel: https://www.apache.org/foundation/
> > Apache Member: https://www.apache.org/foundation/members.html
> >
> > https://www.linkedin.com/pub/christian-mueller/11/551/642
> >
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5736163.html
> >  To unsubscribe from Camel routing issue, click here<
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5730094&code=cHJhYnVtY2EwNkBnbWFpbC5jb218NTczMDA5NHw4OTY0MTU3ODg=
> >
> > .
> > NAML<
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
> --
> Thanks & Regards
>  Prabu.N
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5736224.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to