Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1EBD9200C45 for ; Tue, 14 Mar 2017 02:47:37 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 1D36D160B85; Tue, 14 Mar 2017 01:47:37 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 13A74160B5D for ; Tue, 14 Mar 2017 02:47:35 +0100 (CET) Received: (qmail 63498 invoked by uid 500); 14 Mar 2017 01:47:35 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 63483 invoked by uid 99); 14 Mar 2017 01:47:34 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Mar 2017 01:47:34 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 62EECCBFBD for ; Tue, 14 Mar 2017 01:47:34 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.993 X-Spam-Level: X-Spam-Status: No, score=0.993 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id IFsM4fYovyPp for ; Tue, 14 Mar 2017 01:47:33 +0000 (UTC) Received: from mail-qt0-f179.google.com (mail-qt0-f179.google.com [209.85.216.179]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 46ECF5F659 for ; Tue, 14 Mar 2017 01:47:32 +0000 (UTC) Received: by mail-qt0-f179.google.com with SMTP id n21so45965483qta.1 for ; Mon, 13 Mar 2017 18:47:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=GRY/kDxwNsV7Do7ISd15iktZGmBZ//H/o1ZJ/TSMXVw=; b=pNK4b/FllC+DhbPsJlWc7OLRvevdwLhYz7V/3v520Z7vZQylmfUBK5cNb9ltFQbVLP zhDJfnoSBHmQgtYJ4lpWFbgfk6177f1WQTef/+Ve4h60nZYxsnfBVv5EcTN0jqkMnto/ kxWlaE7kz+i+yINoI0CDZVBLDXbp5XWIbBbzySKB5qtvVlJKVx4xco868dfb/xVr4oR5 kTyRsco3c7kUD0wSKqsHGrnVhLxdDn2ohDXS0pH2tWeiytNvYcsBQP/qJpOYKLHKxhrN EL35aLt5IXU6leq2B5hhZYWmy3Kc37Alt8iQ2mB6JksXBpMVdXlVFTt7Hy/34De4vLdy drGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=GRY/kDxwNsV7Do7ISd15iktZGmBZ//H/o1ZJ/TSMXVw=; b=J+imDUeMJ/f71DUP2WtYM4j4j13WMDX72jGzp+Tx2+I4aEZKBfzI1TBF4nHVDenJ0q Rzi6sMaTMfmGe1AMvzg9y9PjO4FvcoJC8HumeLCpT5SqRN5HYCaiMrkWwBJUkYWXd55C L8zRasmde7f7hkO05Hs5HD9VE1EIj4H1lVIinwWSwzOVfcYXEJjyStuTfb85r6AB2+XV I4EP3kbgsqfM8tke9I36O9FhklCF5pfFv34H/JqZurppspM0BuybdztvkYw8CMu7vC9e 9wOysz3WGwSjFR+AhpAZa1iAkeigpeNgZDl5K8kSj3zmz6otR3CRLkUEa2iQApU41fTR jEtg== X-Gm-Message-State: AMke39m7LHSP975VdN4ZnEJUHw2oHPeeOpusAfNR3pEkpfSJGRPzWHE0FsBNGmIFkXIv+Q== X-Received: by 10.200.42.66 with SMTP id l2mr35658324qtl.33.1489456051124; Mon, 13 Mar 2017 18:47:31 -0700 (PDT) Received: from [192.168.12.56] (p1494088-ipngn8401funabasi.chiba.ocn.ne.jp. [180.0.198.88]) by smtp.googlemail.com with ESMTPSA id q145sm13451184qke.39.2017.03.13.18.47.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Mar 2017 18:47:30 -0700 (PDT) Subject: Re: Sending MQMD headers from Apache camel. To: users@camel.apache.org References: <1489420224536-5795370.post@n5.nabble.com> From: Tomohisa Igarashi Message-ID: <8b8e5ea6-cf80-d79e-fd33-f2e03eb92f4b@gmail.com> Date: Tue, 14 Mar 2017 10:47:28 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1489420224536-5795370.post@n5.nabble.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit archived-at: Tue, 14 Mar 2017 01:47:37 -0000 Ravi, I said "DO NOT post SwitchYard or JBoss question here" again and again. Please stop spamming. On 03/14/2017 12:50 AM, ravi21588 wrote: > Hi All, > iam using Jboss Fuse service works 6.0 with Switchyard 1.1 and camel 2.10. > iam trying to set MQMD headers for the JMS message and send it to IBM MQ. > By seeing camel documentation and various blogs i came to know that this can > be achieved by using Spring destinationResolver. > I would like to set the advanced options destinationResolver as a param and > set the MQMD headers. > Can you please tell me how can i achieve it. > > Switchyardxml: > > xmlns:jms="urn:switchyard-component-camel-jms:config:1.1" > xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" > xmlns:sy="urn:switchyard-config:switchyard:1.1" name="ScaToJms" > targetNamespace="urn:com.company.esb.destinationsystem.in.read.sync:ScaToJms:1.0"> > targetNamespace="urn:com.company.esb.destinationsystem.in.read.sync:ScaToJms:1.0"> > > > > > > interface="com.company.esb.common.services.esbMessageInOutService"/> > > > interface="com.company.esb.common.services.RunnableInOutService"/> > > > interface="com.company.esb.common.services.AuditLodestinationsystemerService"/> > > > interface="com.company.esb.common.services.ExceptionHandlerService"/> > > > promote="destinationsystemInReadSimulator/destinationsystemInReadJmsService"> > interface="com.company.esb.common.services.esbMessageInOutService"/> > > > promote="destinationsystemInReadSimulator/destinationsystemService"> > interface="com.company.esb.common.services.RunnableInOutService"/> > > > > > > > value="com.company.esb.destinationsystem.in.read.customDestinationResolver"/> > > ${destinationsystem.Claws.Read.In} > > ${destinationsystem.In.Read.ConnectionFactoryname} > ${destinationsystem.Claws.Read.Out} > > ${destinationsystem.In.Read.destinationsystemResponseTimeout} > > > multiplicity="0..1" > promote="destinationsystemInReadSimulator/AuditLodestinationsystemerService"> > interface="com.company.esb.common.services.AuditLodestinationsystemerService"/> > sy:targetNamespace="urn:com.company.esb.components:AuditLodestinationsystemer:1.0" > name="ScaAudit"/> > > promote="destinationsystemInReadSimulator/ExceptionHandlerService"> > interface="com.company.esb.common.services.ExceptionHandlerService"/> > sy:targetNamespace="urn:com.company.esb.components:ExceptionHandler:1.0" > name="ScaExceptionHandler"/> > > > > > value="false"/> > > > > > customDestinationResolver.java > > package com.company.esb.destinationsystem.in.read; > > import javax.jms.JMSException; > import javax.jms.Queue; > import javax.jms.QueueSession; > import javax.jms.Session; > > import > org.springframework.jms.support.destination.DynamicDestinationResolver; > > import com.ibm.mq.jms.MQQueue; > > > > > public class customDestinationResolver extends DynamicDestinationResolver { > > private final boolean excludeRFHeaders; > > public customDestinationResolver(boolean excludeRFHeaders) { > this.excludeRFHeaders = excludeRFHeaders; > } > > // public Destination resolveDestinationName(Session session, String > destinationName, boolean pubSubDomain) throws JMSException { > // MQDestination destination = (MQDestination) > super.resolveDestinationName(session, destinationName, pubSubDomain); > // destination.setBooleanProperty(WMQ_MQMD_WRITE_ENABLED, true); > // destination.setBooleanProperty(WMQ_MQMD_READ_ENABLED, true); > // destination.setIntProperty(WMQ_MQMD_MESSAGE_CONTEXT, > WMQ_MDCTX_SET_ALL_CONTEXT); > // if (excludeRFHeaders) { > // destination.setTargetClient(1); > // } > // return destination; > // } > // > protected Queue resolveQueue(Session session, String queueName) throws > JMSException { > MQQueue dest = null; > if (session instanceof QueueSession) { > dest = (MQQueue)((QueueSession) session).createQueue(queueName); > } > else { > dest = (MQQueue)session.createQueue(queueName); > } > // use IBM MQ API to set properties on the Destination > dest.setMQMDWriteEnabled(true); > dest.setMQMDMessageContext(1); > > return dest; > } > > } > > > > Iam gettting below exception: > > Caused by: java.lang.NoClassDefFoundError: > org/springframework/jms/support/destination/DynamicDestinationResolver > at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_80] > at java.lang.ClassLoader.defineClass(ClassLoader.java:800) > [rt.jar:1.7.0_80] > at > org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:361) > [jboss-modules.jar:1.3.3.Final-redhat-1] > at > org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:482) > [jboss-modules.jar:1.3.3.Final-redhat-1] > ... 20 more > Caused by: java.lang.ClassNotFoundException: > org.springframework.jms.support.destination.DynamicDestinationResolver from > [Module "deployment.GGInRead.jar:main" from Service Module Loader] > at > org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) > [jboss-modules.jar:1.3.3.Final-redhat-1] > at > org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) > [jboss-modules.jar:1.3.3.Final-redhat-1] > at > org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) > [jboss-modules.jar:1.3.3.Final-redhat-1] > at > org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) > [jboss-modules.jar:1.3.3.Final-redhat-1] > at > org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) > [jboss-modules.jar:1.3.3.Final-redhat-1] > ... 24 more > > > Can you please let me know if there is anything wrong in my code,also it > would be great if you can share an example. > > > > -- > View this message in context: http://camel.465427.n5.nabble.com/Sending-MQMD-headers-from-Apache-camel-tp5795370.html > Sent from the Camel - Users mailing list archive at Nabble.com. >