Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CE32871FE for ; Thu, 14 Jul 2011 13:48:07 +0000 (UTC) Received: (qmail 8883 invoked by uid 500); 14 Jul 2011 13:48:07 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 8820 invoked by uid 500); 14 Jul 2011 13:48:06 -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 8811 invoked by uid 99); 14 Jul 2011 13:48:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jul 2011 13:48:06 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_FRT_PROFIT1,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gary.tully@gmail.com designates 209.85.216.180 as permitted sender) Received: from [209.85.216.180] (HELO mail-qy0-f180.google.com) (209.85.216.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jul 2011 13:47:59 +0000 Received: by qyk30 with SMTP id 30so227760qyk.11 for ; Thu, 14 Jul 2011 06:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=9KWzxliyOM2v1taHIGdKTqsmq41yFJWTZgyPEPbFKqA=; b=fO/WwVm9J3Gp3mfpk6ln5Rx7/GUpt5YRN5oMhoBmxdzXYBbd6Ix/oq1vKMsZdo1pb1 B7nBSOIn2ZGWVaGfv6lCuCI/w2BPE3X8DEN9bA2g1kESsbPTtzXvFY4e75DRbcOgLv1c MhjYmV+iJfluYdSVESbqHlPomOzrBxjjkGtt8= MIME-Version: 1.0 Received: by 10.229.44.27 with SMTP id y27mr1575669qce.249.1310651258529; Thu, 14 Jul 2011 06:47:38 -0700 (PDT) Received: by 10.229.240.130 with HTTP; Thu, 14 Jul 2011 06:47:38 -0700 (PDT) In-Reply-To: <1310643345087-4586327.post@n5.nabble.com> References: <1310462830160-4578300.post@n5.nabble.com> <1310517331681-4581082.post@n5.nabble.com> <1310559975558-4582476.post@n5.nabble.com> <1310643345087-4586327.post@n5.nabble.com> Date: Thu, 14 Jul 2011 14:47:38 +0100 Message-ID: Subject: Re: Problem with ActiveMQ to Weblogic route From: Gary Tully To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org It makes sense to fix it up such that it can work in your case and I guess to future proof it a bit. The solution may be to make it configurable or plugable, adding a fallback transformer implementation that can be delegated to in this case. I imagine a new public static ActiveMQDestination.setFallbackTransformer() with something that implements public ActiveMQDestination transform(Destination dest) throws JMSExceptio= n Can you raise a jira issue against activemq to track this? On 14 July 2011 12:35, pwanner wrote: > Yes this class is part of activemq-core-5.5.0.jar. > > I did a modification that works correctly reflecting the Destination > parameter to check if in the case of weblogic.jms.common.DestinationImpl = is > has the isQueue and isTopic methods that could help to determine between > Queue and Topic. > > As the problem is closely related to a Weblogic implementation class, I'm > not sure that ActiveMQ would like to embed it in its distribution, even t= hat > using reflection avoid having a dependency to the Weblogic jar. > > > The modification is in bold below: > > =A0 =A0public static ActiveMQDestination transform(Destination dest) thro= ws > JMSException { > =A0 =A0 =A0 =A0if (dest =3D=3D null) { > =A0 =A0 =A0 =A0 =A0 =A0return null; > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0if (dest instanceof ActiveMQDestination) { > =A0 =A0 =A0 =A0 =A0 =A0return (ActiveMQDestination)dest; > =A0 =A0 =A0 =A0} > > =A0 =A0 =A0 =A0if (dest instanceof Queue && dest instanceof Topic) { > =A0 =A0 =A0 =A0 =A0 =A0String queueName =3D ((Queue) dest).getQueueName()= ; > =A0 =A0 =A0 =A0 =A0 =A0String topicName =3D ((Topic) dest).getTopicName()= ; > > =A0 =A0 =A0 =A0 =A0 =A0if (queueName !=3D null && topicName =3D=3D null) = { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return new ActiveMQQueue(queueName); > =A0 =A0 =A0 =A0 =A0 =A0} else if (queueName =3D=3D null && topicName !=3D= null) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return new ActiveMQTopic(topicName); > =A0 =A0 =A0 =A0 =A0 =A0} > > * > =A0 =A0 =A0 =A0 =A0 =A0Method isQueueMethod =3D null; > =A0 =A0 =A0 =A0 =A0 =A0Method isTopicMethod =3D null; > =A0 =A0 =A0 =A0 =A0 =A0try { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0isQueueMethod =3D dest.getClass().getMetho= d("isQueue"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0isTopicMethod =3D dest.getClass().getMetho= d("isTopic"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Boolean isQueue =3D (Boolean)isQueueMethod= .invoke(dest); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Boolean isTopic =3D (Boolean)isTopicMethod= .invoke(dest); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if(isQueue) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return new ActiveMQQueue(queueName= ); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else if(isTopic){ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return new ActiveMQTopic(topicName= ); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0 =A0 =A0} catch (Exception e) {} > * > =A0 =A0 =A0 =A0 =A0throw new JMSException("Could no disambiguate on queue= |Topic-name > totransform pollymorphic destination into a ActiveMQ destination: " + des= t); > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0if (dest instanceof TemporaryQueue) { > =A0 =A0 =A0 =A0 =A0 =A0return new > ActiveMQTempQueue(((TemporaryQueue)dest).getQueueName()); > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0if (dest instanceof TemporaryTopic) { > =A0 =A0 =A0 =A0 =A0 =A0return new > ActiveMQTempTopic(((TemporaryTopic)dest).getTopicName()); > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0if (dest instanceof Queue) { > =A0 =A0 =A0 =A0 =A0 =A0return new ActiveMQQueue(((Queue)dest).getQueueNam= e()); > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0if (dest instanceof Topic) { > =A0 =A0 =A0 =A0 =A0 =A0return new ActiveMQTopic(((Topic)dest).getTopicNam= e()); > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0throw new JMSException("Could not transform the destinatio= n into a > ActiveMQ destination: " + dest); > =A0 =A0} > > -- > View this message in context: http://camel.465427.n5.nabble.com/Problem-w= ith-ActiveMQ-to-Weblogic-route-tp4578300p4586327.html > Sent from the Camel - Users mailing list archive at Nabble.com. > --=20 http://fusesource.com http://blog.garytully.com