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 720C4DFA5 for ; Tue, 25 Sep 2012 10:35:46 +0000 (UTC) Received: (qmail 25710 invoked by uid 500); 25 Sep 2012 10:35:45 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 25571 invoked by uid 500); 25 Sep 2012 10:35:45 -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 24931 invoked by uid 99); 25 Sep 2012 10:35:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Sep 2012 10:35:44 +0000 X-ASF-Spam-Status: No, hits=0.9 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tabish121@gmail.com designates 209.85.216.171 as permitted sender) Received: from [209.85.216.171] (HELO mail-qc0-f171.google.com) (209.85.216.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Sep 2012 10:35:37 +0000 Received: by qcad1 with SMTP id d1so1726931qca.2 for ; Tue, 25 Sep 2012 03:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:date:in-reply-to:references:content-type :x-mailer:content-transfer-encoding:mime-version; bh=yxWest2+8O/K7RsH06epr3u8cPbZ5btGhVq6/o1f77I=; b=ejGCEXWK11SnYCBe6FODNnwoU9QcFaYdj/RaThrc41bY2o/fn2E8TjGeKSJTb5rVRS TaZDV6rPNPZGc97/9JbrAcMsdZKYLoeYazf+cQTTiaa5H60y98IjDU41DaICMjAewb+d Mk2bDUrgRKaO57a8k4DhbVmXjtfNdZYGVoMbAFGulpjrSxe8CqYl5wAX7v0VdXSRu9jJ T1Ik1kN32pT/oTCgU3VzDyEhuPfxKuiRfz6UrcIwRq0KfvWhxLpEylXqkNG/AzHuCNj+ koNE+6GSh3BbXRdDO9SO1UuyOqOaq2PYAx/n7Kj7+g1iJtgaOcwT1yIBvUOZrNWdtAMB IBFQ== Received: by 10.229.136.136 with SMTP id r8mr10830924qct.35.1348569316207; Tue, 25 Sep 2012 03:35:16 -0700 (PDT) Received: from [192.168.2.150] (c-98-231-181-148.hsd1.va.comcast.net. [98.231.181.148]) by mx.google.com with ESMTPS id g18sm291871qan.1.2012.09.25.03.35.14 (version=SSLv3 cipher=OTHER); Tue, 25 Sep 2012 03:35:15 -0700 (PDT) Message-ID: <1348569314.3520.0.camel@OfficePC> Subject: Re: Connection Error to Apache From: Timothy Bish To: users@activemq.apache.org Date: Tue, 25 Sep 2012 06:35:14 -0400 In-Reply-To: References: <1348221594740-4656810.post@n4.nabble.com> <1348494185.2827.3.camel@OfficePC> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 On Mon, 2012-09-24 at 22:36 -0700, maximus wrote: > Tim, > > Did you mean ? > No, you need to properly configure a STOMP transport connector in order to use the NMS.Stomp client. See the below link: http://activemq.apache.org/stomp.html > I will tell what i have been doing so far. Please help me with this setup > as i'm new to messaging > > 1. Downloaded ActiveMQ 5.6.0. Ran the ProducerTool and ConsumerTool > examples provided in the download with "openwire" as the transport > protocol. Works fine. > 2. Created another transportConnector for stomp as shown above. Changed > build.xml file to connect with the new protocol. Works fine. > 3. The above two were tested in java. My client is C# .NET CF. So i created > a consumer and producer sample in C# . I added Apache.NMS and Apache.Stomp > dlls for .NET 3.5 ( just wanted to test as desktop app) . > Running the same gives me the following error : > > ex = {"Unable to read data from the transport connection: An established > connection was aborted by the software in your host machine."} in > TcpTransport. > > Attaching the producer sample below > > using System; > using System.Collections.Generic; > using System.Text; > using Apache.NMS; > using Apache.NMS.Util; > using Apache.NMS.Stomp; > > namespace ActiveMQSample > { > class Program > { > static void Main(string[] args) > { > TestMain test = new TestMain(); > test.CallMe(null); > } > } > public class TestMain > { > public void CallMe(string[] args) > { > // Example connection strings: > // activemq:tcp://activemqhost:61616 > // stomp:tcp://activemqhost:61613 > // ems:tcp://tibcohost:7222 > // msmq://localhost > > Uri connecturi = new Uri("tcp://172.26.37.64:61613"); > //connecturi.Scheme = " "; > > Console.WriteLine("About to connect to " + connecturi); > > // NOTE: ensure the nmsprovider-activemq.config file exists in > the executable folder. > //string broker = > Apache.NMS.Stomp.ConnectionFactory.GetDefaultBrokerUrl(); > IConnectionFactory factory = new ConnectionFactory(connecturi); > > IConnection connection = factory.CreateConnection(); > ISession session = connection.CreateSession(); > // Examples for getting a destination: > // > // Hard coded destinations: > // IDestination destination = session.GetQueue("FOO.BAR"); > // Debug.Assert(destination is IQueue); > // IDestination destination = session.GetTopic("FOO.BAR"); > // Debug.Assert(destination is ITopic); > // > // Embedded destination type in the name: > // IDestination destination = SessionUtil.GetDestination > (session, "queue://FOO.BAR"); > // Debug.Assert(destination is IQueue); > // IDestination destination = SessionUtil.GetDestination > (session, "topic://FOO.BAR"); > // Debug.Assert(destination is ITopic); > // > // Defaults to queue if type is not specified: > // IDestination destination = SessionUtil.GetDestination > (session, "FOO.BAR"); > // Debug.Assert(destination is IQueue); > // > // .NET 3.5 Supports Extension methods for a simplified syntax: > // IDestination destination = session.GetDestination > ("queue://FOO.BAR"); > // Debug.Assert(destination is IQueue); > // IDestination destination = session.GetDestination > ("topic://FOO.BAR"); > // Debug.Assert(destination is ITopic); > > IDestination destination = SessionUtil.GetDestination(session, > "queue://FOO.BAR"); > Console.WriteLine("Using destination: " + destination); > // Create a consumer and producer > //IMessageConsumer consumer = session.CreateConsumer > (destination); > IMessageProducer producer = session.CreateProducer > (destination); > // Start the connection so that messages will be processed. > connection.Start(); > //producer.Persistent = true; > > // Send a message > ITextMessage request = session.CreateTextMessage("Hello > World!"); > request.NMSCorrelationID = "abc"; > request.Properties["NMSXGroupID"] = "cheese"; > request.Properties["myHeader"] = "Cheddar"; > > producer.Send(request); > > // Consume a message > //ITextMessage message = consumer.Receive() as ITextMessage; > //if (message == null) > { > Console.WriteLine("No message received!"); > } > //else > { > // Console.WriteLine("Received message with ID: " + > message.NMSMessageId); > // Console.WriteLine("Received message with text: " + > message.Text); > } > } > } > } > > Regards, > Sujith > > > > > From: "tabish121@gmail.com [via ActiveMQ]" +s2283324n4656848h73@n4.nabble.com> > To: maximus > Date: 09/24/2012 07:14 PM > Subject: Re: Connection Error to Apache > > > > On Fri, 2012-09-21 at 02:59 -0700, sujithmenono wrote: > > > Hi, > > > > I'm trying to write sample code for client/server communication using > > Apache.NMS.Stomp. > > > > Uri connecturi = new Uri("tcp://0.0.0.0:61616"); > > > > Console.WriteLine("About to connect to " + connecturi); > > > > // NOTE: ensure the nmsprovider-activemq.config file exists in the > > executable folder. > > *IConnectionFactory factory = > > NMSConnectionFactory.CreateConnectionFactory(connecturi,null); > > * > > I get the following error while creating the connection factory. > > * > > "No IConnectionFactory implementation found for connection URI: > > tcp://0.0.0.0:61616/"* > > > > This is my setting in activemq.xml > > > > uri="tcp://0.0.0.0:61616"/> > > > > > > You have configured an openwire transport connector on port 61616. You > need to configure a STOMP transport connector. > > > > > > > > > -- > > View this message in context: > http://activemq.2283324.n4.nabble.com/Connection-Error-to-Apache-tp4656810.html > > > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > -- > Tim Bish > Sr Software Engineer | FuseSource Corp > [hidden email] | www.fusesource.com > skype: tabish121 | twitter: @tabish121 > blog: http://timbish.blogspot.com/ > > > > > If you reply to this email, your message will be added to the discussion > below: > http://activemq.2283324.n4.nabble.com/Connection-Error-to-Apache-tp4656810p4656848.html > > To unsubscribe from Connection Error to Apache, click here. > NAML > > > > > > > -- > View this message in context: http://activemq.2283324.n4.nabble.com/Connection-Error-to-Apache-tp4656810p4656886.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. -- Tim Bish Sr Software Engineer | RedHat.com tim.bish@fusesource.com | www.fusesource.com | www.redhat.com skype: tabish121 | twitter: @tabish121 blog: http://timbish.blogspot.com/