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 BA661F2B7 for ; Fri, 5 Jul 2013 13:35:20 +0000 (UTC) Received: (qmail 81066 invoked by uid 500); 5 Jul 2013 13:35:20 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 80925 invoked by uid 500); 5 Jul 2013 13:35:20 -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 80917 invoked by uid 99); 5 Jul 2013 13:35:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Jul 2013 13:35:18 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of elvstone@gmail.com designates 209.85.212.179 as permitted sender) Received: from [209.85.212.179] (HELO mail-wi0-f179.google.com) (209.85.212.179) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Jul 2013 13:35:12 +0000 Received: by mail-wi0-f179.google.com with SMTP id hj3so2145866wib.12 for ; Fri, 05 Jul 2013 06:34:52 -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=pi7nSZt/rddEvKxzXBrtXr2MOnRK+Y9y0sR+HTgr248=; b=sz/DxBslME0NvlcBWBEh36oMuqLmZSfwLvlans5OdzAAU8/WVSlChqoRlYoXUpRvKM YHX7+iaTAikznP955Tb7qkBmpCU7Vr5DXcyUZeVR1xahiN+7i1hlJ0DoffzvLz44gvhJ 7WMYpEht+CFrzmRyPzh0CPuXjbbqZksEN49ci2Z8JGy5silxbAoGq/KK6t8jZ0DXlWyF +DJjIplC1pJIu8MHvIxIlIQS9oD01SkwPjJVNPi8/rMvSl+qfYpRqX75ApLqNoJVroEX PDf5lTGjwyTY15GNa0YRg56x6LakEFmrv9o3gkRxcT3ku7A1JFwW0kcKj4rP3s+eAjpQ ciFA== MIME-Version: 1.0 X-Received: by 10.194.242.134 with SMTP id wq6mr5861185wjc.94.1373031292183; Fri, 05 Jul 2013 06:34:52 -0700 (PDT) Received: by 10.216.173.7 with HTTP; Fri, 5 Jul 2013 06:34:52 -0700 (PDT) In-Reply-To: References: Date: Fri, 5 Jul 2013 15:34:52 +0200 Message-ID: Subject: Re: Composite destinations in old style ActiveMQ Spring configuration From: Elvis Stansvik To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=089e0141a1fc6fb1d404e0c3c2c2 X-Virus-Checked: Checked by ClamAV on apache.org --089e0141a1fc6fb1d404e0c3c2c2 Content-Type: text/plain; charset=ISO-8859-1 With some help from dejanb on IRC I figured it out. It was a simple matter of passing "${jms.queue.audit},my_new_queue" as defaultDestinationName of the JmsTemplate, so much easier than I thought :) Best regards, Elvis Stansvik 2013/7/4 Elvis Stansvik > Hi everyone, > > I've recently been tasked with writing an application that should receive > messages from an existing Spring application (a game server) that uses > ActiveMQ. The game server currently sends messages on a queue called > ${jms.queue.audit}, from which another application (called the "auditor") > receives. > > What I need to do is configure a new queue, parallell to the > ${jms.queue.audit} queue, from which my new application can receive. The > new application should receive exactly the same messages as the auditor. > > Since I'm new to both Spring, JMS and ActiveMQ, I first felt a bit lost. > But I understand that what I need to is probably to configure a composite > destination [1], let's call it ${jms.queue.game_events}, which fans out > into two separate queues ${jms.queue.audit} and ${jms.queue.new_queue}. > E.g. like this: > > ${jms.queue.game_events} ----> ${jms.queue.new_queue} > | > v > ${jms.queue.audit} > > I'd then reconfigure the game server to send messages on the virtual queue > ${jms.queue.game_events}, and they would be delivered both to my new > application and to the auditor. > > Looking at the relevant section of the Spring XML configuration for the > game server, it looks like: > > > > class="org.apache.activemq.ActiveMQConnectionFactory"> > > > > > class="org.apache.activemq.ActiveMQConnectionFactory"> > > > > > > > init-method="start" destroy-method="stop"> > > > > > vm://localhost > > > > > > > ref="jmsFailoverConnectionFactory"/> > > > > > > > > > > > > > > > > > > class="org.apache.activemq.ActiveMQConnectionFactory"> > > > > > > > class="com.straycatstudios.wsc.server.framework.audit.JmsAuditFactory" > depends-on="jvmBroker"> > > > > > > > > class="com.straycatstudios.wsc.server.framework.audit.EventMessageConverter"> > > > > > > > > > > So it looks like it is using standard beans to set up the BrokerService > and other ActiveMQ stuff, instead of using the new style of embedding > ActiveMQ XML configuration inside the Spring XML. The JmsAuditFactory is > the class that does the sending, taking a JmsSender as constructor argument. > > So finally, my question is: How I would go about setting up this composite > destination with a minimal amount of modifications to the Spring XML > configuration? The > > The example at [1] only shows how to do it with the new approach of Spring > configuration, but I'd rather not do invasive things such as converting the > whole thing to the new embedded style, as I'm afraid I'd screw things up. > > Very grateful for any tips/pointers on how to proceed. The full Spring > configuration of the game server is at http://paste.kde.org/789248/raw/ , > in case the above paste is not enough (or mangled). > > Best regards, > Elvis Stansvik > > [1] > http://activemq.apache.org/virtual-destinations.html#VirtualDestinations-CompositeDestinations > --089e0141a1fc6fb1d404e0c3c2c2--