Examples of JmsMessage


Examples of com.consol.citrus.jms.message.JmsMessage

    @Override
    public Message receive(String selector, TestContext context, long timeout) {
        Message receivedMessage = super.receive(selector, context, timeout);

        JmsMessage jmsMessage;
        if (receivedMessage instanceof JmsMessage) {
            jmsMessage = (JmsMessage) receivedMessage;
        } else {
            jmsMessage = new JmsMessage(receivedMessage);
        }

        saveReplyDestination(jmsMessage, context);

        return jmsMessage;
View Full Code Here

Examples of com.ibm.jms.JMSMessage

    {
        UMOEventContext context = RequestContext.getEventContext();
        if (context == null) {
            throw new TransformerException(new org.mule.config.i18n.Message(Messages.NO_CURRENT_EVENT_FOR_TRANSFORMER), this);
        }
        JMSMessage mqMessage = (JMSMessage)src;
        try {
            context.setProperty(JMS_FOLDER_PROPERTY, mqMessage._getJmsFolder());
            if(logger.isDebugEnabled()) logger.debug("Setting " + JMS_FOLDER_PROPERTY + " property to " + context.getProperty(JMS_FOLDER_PROPERTY));
        } catch (JMSException e) {
            throw new TransformerException(new org.mule.config.i18n.Message("mqs", 1, "<jms>"), this, e);
        }
        try {
            context.setProperty(USR_FOLDER_PROPERTY, mqMessage._getUsrFolder());
            if(logger.isDebugEnabled()) logger.debug("Setting " + USR_FOLDER_PROPERTY + " property to " + context.getProperty(USR_FOLDER_PROPERTY));
        } catch (JMSException e) {
            throw new TransformerException(new org.mule.config.i18n.Message("mqs", 1, "<usr>"), this, e);
        }
        try {
            context.setProperty(MCD_FOLDER_PROPERTY, mqMessage._getMcdFolder());
            if(logger.isDebugEnabled()) logger.debug("Setting " + MCD_FOLDER_PROPERTY + " property to " + context.getProperty(MCD_FOLDER_PROPERTY));
        } catch (JMSException e) {
            throw new TransformerException(new org.mule.config.i18n.Message("mqs", 1, "<mcd>"), this, e);
        }
View Full Code Here

Examples of net.lr.karaf.jms.service.JmsMessage

        table.header.add("Redelivered");
        table.header.add("body");
        Enumeration<JmsMessage> messages = this.jmsService.browseQueue(this.queueName, this.selector);
        while (messages.hasMoreElements()) {
            List<String> row = table.addRow();
            JmsMessage jmsMessage = messages.nextElement();
            row.add(jmsMessage.getMessageId());
            row.add(jmsMessage.getCorrelationID());
            row.add(jmsMessage.getReplyTo());
            row.add(jmsMessage.isRedelivered() ? "x" : "");
            row.add(jmsMessage.getContent());
        }
        table.print();
        return null;
    }
View Full Code Here

Examples of org.apache.camel.component.jms.JmsMessage

        return new RouteBuilder() {
            public void configure() throws Exception {
                from("activemq:test.a").process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        // lets set the custom JMS headers using the JMS API
            JmsMessage jmsMessage = assertIsInstanceOf(JmsMessage.class, exchange.getIn());
           
                        jmsMessage.getJmsMessage().setJMSReplyTo(replyQueue);
                        jmsMessage.getJmsMessage().setJMSCorrelationID(correlationID);
                        jmsMessage.getJmsMessage().setJMSType(messageType);
                    }
                }).to("activemq:test.b?preserveMessageQos=true");

                from("activemq:test.b").to("mock:result");
            }
View Full Code Here

Examples of org.apache.camel.component.jms.JmsMessage

       
        // Send a message to the JMS endpoint
        JmsEndpoint endpoint = (JmsEndpoint) container.getEndpoint("jms:test");       
        Producer<JmsExchange> producer = endpoint.createProducer();
        JmsExchange exchange = producer.createExchange();
        JmsMessage in = exchange.getIn();
        in.setBody("Hello");
        in.setHeader("cheese", 123);
        producer.process(exchange);
       
        // The Activated endpoint should send it to the pojo due to the configured route.
        assertTrue("The message ware received by the Pojo", receivedCountDown.await(5, TimeUnit.SECONDS));
       
View Full Code Here

Examples of org.apache.camel.component.jms.JmsMessage

                            public void process(Exchange exchange) throws Exception {
                                // assert camel id is based on jms id
                                String camelId = exchange.getIn().getMessageId();
                                assertNotNull(camelId);

                                JmsMessage jms = (JmsMessage) exchange.getIn();
                                String jmsId = jms.getJmsMessage().getJMSMessageID();
                                assertNotNull(jmsId);

                                assertEquals(jmsId, camelId);
                            }
                        })
View Full Code Here

Examples of org.apache.camel.component.jms.JmsMessage

                    // no response, so lets set a timed out exception
                    String msg = "reply message with correlationID: " + holder.getCorrelationId() + " not received";
                    exchange.setException(new ExchangeTimedOutException(exchange, holder.getRequestTimeout(), msg));
                } else {
                    JmsMessage response = new JmsMessage(message, endpoint.getBinding());
                    Object body = response.getBody();

                    if (endpoint.isTransferException() && body instanceof Exception) {
                        log.debug("Reply received. Setting reply as an Exception: {}", body);
                        // we got an exception back and endpoint was configured to transfer exception
                        // therefore set response as exception
View Full Code Here

Examples of org.apache.camel.component.jms.JmsMessage

        return new RouteBuilder() {
            public void configure() throws Exception {
                from("activemq:test.a").process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        // lets set the custom JMS headers using the JMS API
            JmsMessage jmsMessage = assertIsInstanceOf(JmsMessage.class, exchange.getIn());
           
                        jmsMessage.getJmsMessage().setJMSReplyTo(replyQueue);
                        jmsMessage.getJmsMessage().setJMSCorrelationID(correlationID);
                        jmsMessage.getJmsMessage().setJMSType(messageType);
                    }
                }).to("activemq:test.b?preserveMessageQos=true");

                from("activemq:test.b").to("mock:result");
            }
View Full Code Here

Examples of org.apache.camel.component.jms.JmsMessage

        return new RouteBuilder() {
            public void configure() throws Exception {
                from("activemq:test.a").process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        // lets set the custom JMS headers using the JMS API
            JmsMessage jmsMessage = assertIsInstanceOf(JmsMessage.class, exchange.getIn());
           
                        jmsMessage.getJmsMessage().setJMSReplyTo(replyQueue);
                        jmsMessage.getJmsMessage().setJMSCorrelationID(correlationID);
                        jmsMessage.getJmsMessage().setJMSType(messageType);
                    }
                }).to("activemq:test.b?preserveMessageQos=true");

                from("activemq:test.b").to("mock:result");
            }
View Full Code Here

Examples of org.apache.camel.component.jms.JmsMessage

                from("activemq:topic:ActiveMQ.Advisory.Queue?cacheLevelName=CACHE_CONSUMER").process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        Message in = exchange.getIn();
                        if (in instanceof JmsMessage) {
                            JmsMessage jmsMessage = (JmsMessage) in;
                            javax.jms.Message value = jmsMessage.getJmsMessage();
                            if (value instanceof ActiveMQMessage) {
                                ActiveMQMessage activeMQMessage = (ActiveMQMessage) value;
                                DataStructure structure = activeMQMessage.getDataStructure();
                                if (structure instanceof DestinationInfo) {
                                    DestinationInfo destinationInfo = (DestinationInfo) structure;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.