You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Harley Blumenfeld (JIRA)" <ji...@apache.org> on 2014/10/01 15:50:33 UTC

[jira] [Comment Edited] (AMQNET-490) Stomp Client 1.5.4 error creating subscription to topic on JBoss HornetQ (Jboss 6.4.2 GA)

    [ https://issues.apache.org/jira/browse/AMQNET-490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14154801#comment-14154801 ] 

Harley Blumenfeld edited comment on AMQNET-490 at 10/1/14 1:49 PM:
-------------------------------------------------------------------

I am re-opening this issue because this is not configurable via the wire format as Timothy said. It is hard-coded in the  ConvertToStompString method in the Apache.NMS.Stomp.Commands.Destionation class. Here is the code block:

 public static string ConvertToStompString(Destination destination)
        {
            if(destination == null)
            {
                return null;
            }

            string result;

            switch(destination.DestinationType)
            {
                case DestinationType.Topic:
                    result = "/topic/" + destination.PhysicalName;
                    break;
                case DestinationType.TemporaryTopic:
                    result = (destination.RemoteDestination ? "/remote-temp-topic/" : "/temp-topic/") + destination.PhysicalName;
                    break;
                case DestinationType.TemporaryQueue:
                    result = (destination.RemoteDestination ? "/remote-temp-queue/" : "/temp-queue/") + destination.PhysicalName;
                    break;
                default:
                    result = "/queue/" + destination.PhysicalName;
                    break;
            }

            return result;
        }


was (Author: harleybl):
I am re-opening this issue because this is not configurable via the wire format as Timothy said. It is hard-coded in the  ConvertToStompString method in the Apache.NMS.Stomp.Commands.Destionation class. Here is the code block:

 public static string ConvertToStompString(Destination destination)
        {
            if(destination == null)
            {
                return null;
            }

            string result;

            switch(destination.DestinationType)
            {
                case DestinationType.Topic:
                    result = "/topic/" + destination.PhysicalName;
                    break;
                case DestinationType.TemporaryTopic:
                    result = (destination.RemoteDestination ? "/remote-temp-topic/" : "/temp-topic/") + destination.PhysicalName;
                    break;
                case DestinationType.TemporaryQueue:
                    result = (destination.RemoteDestination ? "/remote-temp-queue/" : "/temp-queue/") + destination.PhysicalName;
                    break;
                default:
                    result = "/queue/" + destination.PhysicalName;
                    break;
            }

            return result;
        }

> Stomp Client 1.5.4 error creating subscription to topic on JBoss HornetQ (Jboss 6.4.2 GA)
> -----------------------------------------------------------------------------------------
>
>                 Key: AMQNET-490
>                 URL: https://issues.apache.org/jira/browse/AMQNET-490
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: ActiveMQ, Stomp
>    Affects Versions: 1.5.4
>            Reporter: Harley Blumenfeld
>            Assignee: Jim Gomes
>
> Maybe I am doing something dumb, but using a simple example I cannot seem to get a topic subscription working using the Apache.NMS.Stomp version 1.5.4 (http://activemq.apache.org/nms/apachenmsstomp-v154.html).
> I am compiling the Stomp source code and project under .Net 4.0. I have created a console application in the Apache.NMS.Stomp solution. My program fails when it attempts to create a subscription to the topic. The same example works fine with the 1.5.3 version of the DLL so this seems like it could be a bug.
> <b>Here is the result of my simple program:</b>
> About to connect to stomp:tcp://myjboss:61613
> Using destination: topic://jms.topic.test.topic
> Connection Error: : Error creating subscription IDcSTHBLUMENF-50514-635475847768724525-1:0c1:1
> Connection Error:
> Error: : Error creating subscription IDcSTHBLUMENF-50514-635475847768724525-1:0c1:1
> Error:   at Apache.NMS.Stomp.Connection.SyncRequest(Command command, TimeSpan requestTimeout) in C:\dev\Apache.NMS.Stomp\source\branches\1.5.4\src\main\csharp\Connection.cs:line 525
>    at Apache.NMS.Stomp.Connection.SyncRequest(Command command) in C:\dev\Apache.NMS.Stomp\source\branches\1.5.4\src\main\csharp\Connection.cs:line 505
>    at Apache.NMS.Stomp.Session.CreateConsumer(IDestination destination, String selector, Boolean noLocal) in C:\dev\Apache.NMS.Stomp\source\branches\1.5.4\src\main\csharp\Session.cs:line 425
>    at Apache.NMS.Stomp.Session.CreateConsumer(IDestination destination) in C:\dev\Apache.NMS.Stomp\source\branches\1.5.4\src\main\csharp\Session.cs:line 379
>    at TopicSubscriberTest.Program.Main(String[] args) in C:\dev\Apache.NMS.Stomp\source\branches\1.5.4\TopicSubscribeTest\Program.cs:line 31
> <b>Here is the code:</b>
> class Program
> {                
> 	private static void Main(string[] args)
> 	{
> 		try
> 		{
> 			var connecturi = new Uri("stomp:tcp://myjboss:61613");
> 			Console.WriteLine("About to connect to " + connecturi);
> 			IConnectionFactory factory = new NMSConnectionFactory(connecturi);
> 			<b>using (IConnection connection = factory.CreateConnection("testuser", "test"))</b>
> 			{
> 				connection.ExceptionListener += new ExceptionListener(OnConnectionException);
> 				connection.Start();
> 				using (ISession session = connection.CreateSession())
> 				{                        
> 					connection.Start();                        
> 					IDestination destination = SessionUtil.GetDestination(session,"topic://jms.topic.test.topic");
> 					Console.WriteLine("Using destination: " + destination);
> 					using (IMessageConsumer consumer = session.CreateConsumer(destination))
> 					{                                                        
> 						consumer.Listener += OnMessage;
> 						while (true)
> 						{
> 							Thread.Sleep(5000);
> 							Console.WriteLine(".");
> 						}
> 					}
> 				}
> 			}
> 		}
> 		catch (Exception e)
> 		{
> 			Console.WriteLine("Error:" + e.Message);
> 			Console.WriteLine("Error:" + e.StackTrace);
> 			Console.ReadLine();
> 		}
> 	}
> 	private static void OnConnectionException(Exception e)
> 	{
> 		Console.WriteLine("Connection Error:" + e.Message);
> 		Console.WriteLine("Connection Error:" + e.StackTrace);
> 	}
> 	protected static void OnMessage(IMessage receivedMsg)
> 	{
> 		var message = receivedMsg as ITextMessage;
> 		Console.WriteLine(message.Text);
> 	}
> }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)