Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-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 B543A18C77 for ; Fri, 19 Jun 2015 04:21:29 +0000 (UTC) Received: (qmail 12806 invoked by uid 500); 19 Jun 2015 04:21:29 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 12769 invoked by uid 500); 19 Jun 2015 04:21:29 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 12757 invoked by uid 99); 19 Jun 2015 04:21:28 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jun 2015 04:21:28 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 6FA501A5D60 for ; Fri, 19 Jun 2015 04:21:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.706 X-Spam-Level: X-Spam-Status: No, score=0.706 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HK_LOTTO_NAME=0.806, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id DOmlO-pIA3a6 for ; Fri, 19 Jun 2015 04:21:22 +0000 (UTC) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 98E53428E3 for ; Fri, 19 Jun 2015 04:21:21 +0000 (UTC) Received: by lbbvz5 with SMTP id vz5so16593995lbb.0 for ; Thu, 18 Jun 2015 21:21:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Y2z/TwXUiCi9rOzXW5toMwUz18uVmXxET/FNoIRCEaA=; b=j/tQiO1ZFhBDUMpFER0unelhDCe1THif8smWwL/GrGEHJRTn7UbCltxbAlHcrbG5Vx 1lFL1SZpdzWZS4tfzoyso/JwD8q0eVC6DOV4I1WiTmUKIeNZO8T5Fr6SKobBSxZCPPaM H/+liqgNY3QkyrJohtR7+omB6YI4Sko+uj0YrikBKY3y+AmaOA8BBomS3rRzS9r5FB19 v9N8DtFznTjHaly9B3BqVMVT1QO5h4LrMg1Z+pPGOp7zmfQpE3h5UUrHqI29CDVp4hPy y6V63Go4HYXrBycFfK9itHZ8ED40wuL560x5sv/qBoiL+9MuX9FmZOWnUhc+TmWu39xf Ffew== MIME-Version: 1.0 X-Received: by 10.112.55.207 with SMTP id u15mr15891677lbp.88.1434687680599; Thu, 18 Jun 2015 21:21:20 -0700 (PDT) Received: by 10.112.6.102 with HTTP; Thu, 18 Jun 2015 21:21:20 -0700 (PDT) In-Reply-To: References: Date: Fri, 19 Jun 2015 09:51:20 +0530 Message-ID: Subject: Re: Can I make createQueue on embedded broker session create a queue on the remote broker as well? From: pubudu gunawardena To: users@activemq.apache.org Content-Type: text/plain; charset=UTF-8 Thanks for the information Tim. I tried 'dynamic networks' setup and the queues are getting created. One thing that I would like to know is, when should the JMS to JMS connection be used and when should the Network connection be used? Is there any other difference when using the dynamic network setup (other than messages not being sent until a consumer is available)? On Thu, Jun 18, 2015 at 6:29 PM, Tim Bain wrote: > Have you set up your dynamically included destinations as described by the > "dynamic networks" section of > http://activemq.apache.org/networks-of-brokers.html? > > Note that under that setup, messages will be forwarded to the standalone > remote broker only if there is a currently-attached consumer on the remote > broker; if there is no consumer, messages will stay on whichever broker > they were first sent to. If that's not acceptable, the normal solution is > to use statically included destinations (see the "pure static networks" > section just below), but as far as I know there's no way to use wildcards > so you'd have to list them all in advance. > > Tim > On Jun 18, 2015 6:05 AM, "pubudu gunawardena" wrote: > >> To elaborate more, I am using an embedded broker to gain the benefits >> mentioned at >> http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html >> . >> But I want to dynamically create queues without knowing the name >> beforehand. >> >> On Thu, Jun 18, 2015 at 5:32 PM, pubudu gunawardena >> wrote: >> > Hi All, >> > >> > I am quite new to ActiveMQ and am trying to figure out a solution to >> > the following. >> > >> > I have an embedded broker and a remote broker. >> > From my code I do the following to create a session on the embedded >> > broker and to create a queue there. >> > >> > factory = new >> ActiveMQConnectionFactory("tcp://localhost:61617"); >> > connection = factory.createConnection(); >> > connection.start(); >> > session = connection.createSession(false, >> Session.AUTO_ACKNOWLEDGE); >> > destination = session.createQueue("SAMPLEQUEUE"); >> > >> > I want a queue with the same name to be created on the remote broker >> > when I do that and any messages I send to that queue on the embedded >> > broker to go to the remote broker. >> > >> > I have looked at the the documentation on JMS to JMS Bridge mentioned >> > at http://activemq.apache.org/jms-to-jms-bridge.html but it seems that >> > I have to know the queue name beforehand in order to create a >> > OutboundQueueBridge. >> > >> > Is there any way that I can dynamically create the queue on the >> > remote broker when I call the createConnection as I have mentioned >> > above? Is there any configuration in the JMS to JMS bridge which >> > enables that? >> > -- >> > Thanks, >> > Pubudu >> >> >> >> -- >> Thanks, >> Pubudu >> -- Thanks, Pubudu