Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 77852 invoked from network); 22 Mar 2011 19:53:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Mar 2011 19:53:02 -0000 Received: (qmail 39315 invoked by uid 500); 22 Mar 2011 19:53:01 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 39280 invoked by uid 500); 22 Mar 2011 19:53:01 -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 39272 invoked by uid 99); 22 Mar 2011 19:53:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Mar 2011 19:53:01 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tabish121@gmail.com designates 209.85.216.43 as permitted sender) Received: from [209.85.216.43] (HELO mail-qw0-f43.google.com) (209.85.216.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Mar 2011 19:52:56 +0000 Received: by qwf6 with SMTP id 6so6667312qwf.2 for ; Tue, 22 Mar 2011 12:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:from:to:in-reply-to:references :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=TT7mrihMY22rdReWdpHP430nxr8qgKo7UMOG+Q2mE40=; b=j9jZC7bjK3oESm2B6OWL3TbbVSlZz8hHHGSyN36Y6pycXo9jn/oEpYNRYuHaF4KJuD MtnwvIM9glLSy3lyW7N8FWHT7619RPF0D7VV+RTSVxE7VYyulgDr5JTpFU3TfusdHimp ibOC1egGoThzH/gcXoMF0iNoXJj0ySpqYaG4s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; b=DiMD8nsoOiM8KmXGaY+j1mcN0TrCYVAfPbrwtbXGdXQ3wc+ZrVcIoexxn89bfFqvD3 oOTwGlNnGD/4CoG7mP2LosQNa1iOZCBDnJgI9Q+ieYTVmp0YDXTsfhIaw0LXSOWqi8Ku OWtVMAuSzLnX5m51yZWeufJVUxtBMV9aIFnrI= Received: by 10.229.63.151 with SMTP id b23mr5083594qci.289.1300823555436; Tue, 22 Mar 2011 12:52:35 -0700 (PDT) Received: from [192.168.2.150] (c-69-143-50-138.hsd1.va.comcast.net [69.143.50.138]) by mx.google.com with ESMTPS id g26sm5482144qco.6.2011.03.22.12.52.33 (version=SSLv3 cipher=OTHER); Tue, 22 Mar 2011 12:52:34 -0700 (PDT) Subject: Re: IConnection.start() - optional? From: Timothy Bish To: users@activemq.apache.org In-Reply-To: <1300821704529-3397472.post@n4.nabble.com> References: <1300821704529-3397472.post@n4.nabble.com> Content-Type: text/plain; charset="UTF-8" Date: Tue, 22 Mar 2011 15:52:33 -0400 Message-ID: <1300823553.2686.10.camel@office> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 (2.32.2-1.fc14) Content-Transfer-Encoding: 7bit On Tue, 2011-03-22 at 12:21 -0700, olsonpm wrote: > I was trying to implement a persistent producer using NMS and ActiveMQ. I > realized the function isStarted wasn't returning true, even though my > messages were successfully being sent. I chalked this up to not calling > connection.start(). However, if the connection isn't running, how are the > messages sending? Connection start / stop applies only to the dispatch of Messages to consumers. A client can send messages without starting a Connection. Regards Tim > > Here's the following code that runs as intended > ----------------------------------- > > Imports System > Imports System.Collections.Generic > Imports System.Text > > Imports Apache.NMS.ActiveMQ > Imports Apache.NMS > > Module Module1 > > Private Const URI As String = "myURI" > Private Const DEST As String = "myQueue" > > Sub Main() > > Console.Write("press any key to start: ") > Console.ReadKey() > Console.WriteLine(vbNewLine) > > Dim df As ConnectionFactory = New ConnectionFactory(URI) > Dim conn As IConnection = df.CreateConnection() > Using conn > Dim session As ISession = conn.CreateSession > Using session > If (conn.IsStarted) Then > Console.WriteLine("connection has started") '<--doesn't > display > End If > Dim prod As IMessageProducer = session.CreateProducer(New > Commands.ActiveMQQueue(DEST)) > Dim msg As ITextMessage = prod.CreateTextMessage() > msg.Text = "Hello world" > msg.Properties("OriginUnit") = "3039" > msg.Properties("OriginDept") = "MME" > msg.Properties("MessageType") = "AutomatedPalletScan" > Console.WriteLine("Sending: " & msg.Text) > prod.Send(msg) > > Console.Write(vbNewLine & "press any key to end: ") > Console.ReadKey() > End Using > End Using > End Sub > > End Module > > > -- > View this message in context: http://activemq.2283324.n4.nabble.com/IConnection-start-optional-tp3397472p3397472.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. -- Tim Bish ------------ FuseSource Email: tim.bish@fusesource.com Web: http://fusesource.com Twitter: tabish121 Blog: http://timbish.blogspot.com/