You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by sujithmenono <su...@oatsystems.com> on 2012/09/21 11:59:54 UTC
Connection Error to Apache
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
<transportConnectors>
<transportConnector name="default" uri="tcp://0.0.0.0:61616"/>
</transportConnectors>
--
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.
Re: Connection Error to Apache
Posted by sujithmenono <su...@oatsystems.com>.
I changed to
IConnectionFactory factory = new Apache.NMS.Stomp.ConnectionFactory(broker,
"1");
but
using (IConnection connection = factory.CreateConnection()) fails "Error
connecting to localhost:61613"
--
View this message in context: http://activemq.2283324.n4.nabble.com/Connection-Error-to-Apache-tp4656810p4656812.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Connection Error to Apache
Posted by maximus <su...@oatsystems.com>.
Guys, Can you please let me know if there are any configuration items that
needs to be added for setting up the whole thing. Please help.
--
View this message in context: http://activemq.2283324.n4.nabble.com/Connection-Error-to-Apache-tp4656810p4656843.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Connection Error to Apache
Posted by maximus <su...@oatsystems.com>.
This is the error that i see.
error = {"The output char buffer is too small to contain the decoded
characters, encoding 'Unicode (UTF-8)' fallback
'System.Text.DecoderReplacementFallback'.\r\nParameter name: chars"}
--
View this message in context: http://activemq.2283324.n4.nabble.com/Connection-Error-to-Apache-tp4656810p4656842.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Connection Error to Apache
Posted by maximus <su...@oatsystems.com>.
Hi,
I'm able to create a connection now but im unable to create the consumer.
I get a ConnectionClosedException in "IMessageConsumer consumer =
session.CreateConsumer(destination)"
Attaching the stack trace for reference
Apache.NMS.Stomp.dll!Apache.NMS.Stomp.Session.Close() Line 278 C#
Apache.NMS.Stomp.dll!Apache.NMS.Stomp.Session.Dispose(bool disposing =
true) Line 248 + 0x9 bytes C#
Apache.NMS.Stomp.dll!Apache.NMS.Stomp.Session.Dispose() Line 230 + 0xc
bytes C#
>
Apache.NMS.Stomp.dll!Apache.NMS.Stomp.Connection.AsyncOnExceptionHandler(object
error = {"The output char buffer is too small to contain the decoded
characters, encoding 'Unicode (UTF-8)' fallback
'System.Text.DecoderReplacementFallback'.\r\nParameter name: chars"}) Line
762 + 0x10 bytes C#
Apache.NMS.Stomp.dll!Apache.NMS.Stomp.Threads.ThreadPoolExecutor.Future.Run()
Line 63 + 0x23 bytes C#
Apache.NMS.Stomp.dll!Apache.NMS.Stomp.Threads.ThreadPoolExecutor.QueueProcessor(object
unused = null) Line 150 + 0x10 bytes C#
--
View this message in context: http://activemq.2283324.n4.nabble.com/Connection-Error-to-Apache-tp4656810p4656840.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Connection Error to Apache
Posted by maximus <su...@oatsystems.com>.
Thanks Tim. Got it working on desktop sample but when i try deploying the
sample on the device emulator the same sample fails. I'm using CF v2.0
binaries that i downloaded.
// msmq://localhost
Uri connecturi = new Uri("tcp://172.17.254.86:61613");
Console.WriteLine("About to connect to " + connecturi);
// NOTE: ensure the nmsprovider-activemq.config file exists in
the executable folder.
IConnectionFactory factory = new
Apache.NMS.Stomp.ConnectionFactory(connecturi);
using (IConnection connection = factory.CreateConnection())
It throws up and NMSConnectionException "Error Connecting to ..." Looks
like the socket could not be created. Any ideas?
regards,
Sujith
From: "tabish121@gmail.com [via ActiveMQ]" <ml-node
+s2283324n4656903h78@n4.nabble.com>
To: maximus <su...@oatsystems.com>
Date: 09/25/2012 04:06 PM
Subject: Re: Connection Error to Apache
On Mon, 2012-09-24 at 22:36 -0700, maximus wrote:
> Tim,
>
> Did you mean <transportConnector name="Stomp" uri="tcp://0.0.0.0:61613
> "/> ?
>
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: "[hidden email] [via ActiveMQ]" <ml-node
> +[hidden email]>
> To: maximus <[hidden email]>
> 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
> > <transportConnectors>
> > <transportConnector name="default"
> uri="tcp://0.0.0.0:61616"/>
> > </transportConnectors>
> >
>
> You have configured an openwire transport connector on port 61616. You
> need to configure a STOMP transport connector.
>
> <transportConnector name="Stomp" uri="stomp://0.0.0.0:61613"/>
>
> >
> >
> > --
> > 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
[hidden email] | www.fusesource.com | www.redhat.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-tp4656810p4656903.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-tp4656810p4656938.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Connection Error to Apache
Posted by maximus <su...@oatsystems.com>.
Ok. It works fine. Was a problem with setting up the emulator.
I needed one more clarification regarding the usage. Let's say i have a
client and a server. Is the assumption of reliable messaging based on the
fact that activemq is always running on the server machine?
What if the server machine is down? From what i understand, i will be
losing the messages that i send when the server is down (even if the client
is already connected)
Is it a good idea to have a broker on the client machine and then somehow
move messages from client queue to server queue whenever the server
(activemq) comes online?
Considering the fact that i'm using a mobile device as my client (where
memory is limited) does it make sense to run the broker on the client (if
at all there is any broker available for compact framework)
Also, let me know if message synchronization is supported when multiple
clients want to pump in data into the same queue on the server.
Regards,
Sujith
From: Sujith Menon/OAT/CKP
To: "tabish121@gmail.com [via ActiveMQ]" <ml-node
+s2283324n4656903h78@n4.nabble.com>
Date: 09/25/2012 07:26 PM
Subject: Re: Connection Error to Apache
Thanks Tim. Got it working on desktop sample but when i try deploying the
sample on the device emulator the same sample fails. I'm using CF v2.0
binaries that i downloaded.
// msmq://localhost
Uri connecturi = new Uri("tcp://172.17.254.86:61613");
Console.WriteLine("About to connect to " + connecturi);
// NOTE: ensure the nmsprovider-activemq.config file exists in
the executable folder.
IConnectionFactory factory = new
Apache.NMS.Stomp.ConnectionFactory(connecturi);
using (IConnection connection = factory.CreateConnection())
It throws up and NMSConnectionException "Error Connecting to ..." Looks
like the socket could not be created. Any ideas?
regards,
Sujith
From: "tabish121@gmail.com [via ActiveMQ]" <ml-node
+s2283324n4656903h78@n4.nabble.com>
To: maximus <su...@oatsystems.com>
Date: 09/25/2012 04:06 PM
Subject: Re: Connection Error to Apache
On Mon, 2012-09-24 at 22:36 -0700, maximus wrote:
> Tim,
>
> Did you mean <transportConnector name="Stomp" uri="tcp://0.0.0.0:61613
> "/> ?
>
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: "[hidden email] [via ActiveMQ]" <ml-node
> +[hidden email]>
> To: maximus <[hidden email]>
> 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
> > <transportConnectors>
> > <transportConnector name="default"
> uri="tcp://0.0.0.0:61616"/>
> > </transportConnectors>
> >
>
> You have configured an openwire transport connector on port 61616. You
> need to configure a STOMP transport connector.
>
> <transportConnector name="Stomp" uri="stomp://0.0.0.0:61613"/>
>
> >
> >
> > --
> > 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
[hidden email] | www.fusesource.com | www.redhat.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-tp4656810p4656903.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-tp4656810p4656987.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Connection Error to Apache
Posted by Timothy Bish <ta...@gmail.com>.
On Mon, 2012-09-24 at 22:36 -0700, maximus wrote:
> Tim,
>
> Did you mean <transportConnector name="Stomp" uri="tcp://0.0.0.0:61613
> "/> ?
>
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]" <ml-node
> +s2283324n4656848h73@n4.nabble.com>
> To: maximus <su...@oatsystems.com>
> 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
> > <transportConnectors>
> > <transportConnector name="default"
> uri="tcp://0.0.0.0:61616"/>
> > </transportConnectors>
> >
>
> You have configured an openwire transport connector on port 61616. You
> need to configure a STOMP transport connector.
>
> <transportConnector name="Stomp" uri="stomp://0.0.0.0:61613"/>
>
> >
> >
> > --
> > 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/
Re: Connection Error to Apache
Posted by maximus <su...@oatsystems.com>.
Tim,
Did you mean <transportConnector name="Stomp" uri="tcp://0.0.0.0:61613
"/> ?
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]" <ml-node
+s2283324n4656848h73@n4.nabble.com>
To: maximus <su...@oatsystems.com>
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
> <transportConnectors>
> <transportConnector name="default"
uri="tcp://0.0.0.0:61616"/>
> </transportConnectors>
>
You have configured an openwire transport connector on port 61616. You
need to configure a STOMP transport connector.
<transportConnector name="Stomp" uri="stomp://0.0.0.0:61613"/>
>
>
> --
> 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.
Re: Connection Error to Apache
Posted by maximus <su...@oatsystems.com>.
Hi Tim,
We have a C# Compact Framework client and java as the server side.
Assuming that the stomp broker(activemq ) should be running on both the
client and server what is the equivalent of running bin/activemq on the
client?
Regards,
Sujith
From: "tabish121@gmail.com [via ActiveMQ]" <ml-node
+s2283324n4656848h73@n4.nabble.com>
To: maximus <su...@oatsystems.com>
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
> <transportConnectors>
> <transportConnector name="default"
uri="tcp://0.0.0.0:61616"/>
> </transportConnectors>
>
You have configured an openwire transport connector on port 61616. You
need to configure a STOMP transport connector.
<transportConnector name="Stomp" uri="stomp://0.0.0.0:61613"/>
>
>
> --
> 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-tp4656810p4656878.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Connection Error to Apache
Posted by Timothy Bish <ta...@gmail.com>.
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
> <transportConnectors>
> <transportConnector name="default" uri="tcp://0.0.0.0:61616"/>
> </transportConnectors>
>
You have configured an openwire transport connector on port 61616. You
need to configure a STOMP transport connector.
<transportConnector name="Stomp" uri="stomp://0.0.0.0:61613"/>
>
>
> --
> 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
tim.bish@fusesource.com | www.fusesource.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/