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

jim yu commented on AMQNET-249:
-------------------------------

Hi, Timothy,

Thanks for your reply and the information, but I think I am using a queue not a 
topic. The following is the code I using to send the msg...
Please kind help me if you know what's wrong this code...

PS: Another issue, say Sender is runing, but Receiver is off. When Sender sent 
a message to the queue, I should be able to see a pending message in queue from 
the web console, but I didn't see any. Please help me if you know about this. 
Thanks a lot!

Sender
--------------------------------------------------------------------------------------
        Dim properties As Apache.NMS.IPrimitiveMap
        Dim connection As IConnection
        Dim session As ISession
        Dim destination As IDestination
        Dim consumer As IMessageConsumer
        Dim producer As IMessageProducer
        Dim oTimeout As TimeSpan
        Dim factory As IConnectionFactory
        Dim ConnURI As Uri

        ConnURI = New Uri("activemq:tcp://localhost:61616")
        factory = New NMSConnectionFactory(ConnURI)
        connection = factory.CreateConnection()
        session = connection.CreateSession()

        connection.Start()
        oTimeout = New TimeSpan(1)
        destination = Util.SessionUtil.GetDestination(session, "queue://TESTMQ")
        consumer = session.CreateConsumer(destination)
        producer = session.CreateProducer(destination)
        request = session.CreateTextMessage("Test Msg...")
        properties = request.Properties
        properties.Item("NMSXGroupID") =  "TEST"
        request.NMSCorrelationID = "ID0001"
        producer.RequestTimeout =   oTimeout 
        producer.TimeToLive =   oTimeout 
        producer.Send(request)
------------------------------------------------------------------------------------------------------------------------------

Receiver
------------------------------------------------------------------------------------------------------------------------------
      
        Dim connection As IConnection
        Dim session As ISession
        Dim destination As IDestination
        Dim consumer As IMessageConsumer
        Dim producer As IMessageProducer
         Dim factory As IConnectionFactory
        Dim ConnURI As Uri
        Dim oRecMsg As Apache.NMS.IMessage
   
        ConnURI = New Uri("activemq:tcp://localhost:61616")
        factory = New NMSConnectionFactory(ConnURI)
        connection = factory.CreateConnection()
   
        session = connection.CreateSession()
    
       destination = Util.SessionUtil.GetDestination(session, "queue://" & 
txtMQName.Text)
        consumer = session.CreateConsumer(destination)
        producer = session.CreateProducer(destination)

       connection.Start()

       oRecMsg = consumer.Receive()
------------------------------------------------------------------------------------------------------------------------------


> Is API Receive having ordering problem?
> ---------------------------------------
>
>                 Key: AMQNET-249
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-249
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: NMS
>    Affects Versions: 1.1.0
>         Environment: ActiveMQ is running on Linunx Ubuntu,  VB.NET + 
> Apache.NMS is running on WinXP
>            Reporter: jim yu
>            Assignee: Jim Gomes
>   Original Estimate: 1 hour
>  Remaining Estimate: 1 hour
>
> Hi, All,
> If try the following steps, the API receive won't work normally..
> 1. have 2 programs, one is sender for sending message to actuvemq, another is 
> receiver for receiving message from activemq.
> 2. Start a connection from the sender to activemq first.
> 3. Start a connection from the receiver to qctivemq and call consumer.Receive 
> (API Receive) to wait for retrieving data form activemq.
> 4. Call request.send (API Send)  to send a message to activemq in sender.
> 5. The data will be drop by activemq but Receiver will never get data from 
> activemq.
> However, API Receive will work normally if start the receiver first and then 
> start the sender.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to