qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Howard <chris.how...@facilita.co.uk>
Subject Request/response between .NET server and python client
Date Wed, 11 Aug 2010 08:54:22 GMT
  Hi,

I am having difficulty with sending a simple request/response between a 
server written in C# and a client written in python. I have no such 
problems when the client and server are both written in python. I am 
using qpid 0.7 (built from the trunk approx. 3 weeks ago)

Here is the code for the C# server:

try
             {
                 Connection connection = new Connection("localhost:5672");
                 connection.Open();
                 Session session = connection.CreateSession();
                 Receiver receiver = session.CreateReceiver("send ; 
{create: always, delete: always}");

                 while (true)
                 {
                     Message request = 
receiver.Fetch(DurationConstants.FORVER);
                     Sender sender = session.CreateSender(request.ReplyTo);
                     Message response = new Message("pong");
                     sender.Send(response);
                 }
             }
             catch (System.Exception e)
             {
                 Console.WriteLine(e.ToString());
             }

And here is the code for the python client:

import qpid.messaging

connection = qpid.messaging.Connection('amqp://localhost:5672')
connection.open()
session = connection.session()
receiver = session.receiver('#reply ; {create: always, delete: always}')
sender = session.sender('send ; {create: always, delete: always}')
request = qpid.messaging.Message(content = 'ping', reply_to = 
receiver.source)
sender.send(request)
response = receiver.fetch(10)
print response.content
connection.close()

I start the server, and then start the client. The server receives the 
request from the client, but the call to CreateSender throws an 
exception with the message:

"Exchange 9224f93b-8c4b-4675-bc04-61e721387140#reply does not exist"

Furthermore, there is another exception thrown during program exit:

Unhandled Exception: System.AccessViolationException: Attempted to read 
or write
  protected memory. This is often an indication that other memory is 
corrupt.
    at qpid.messaging.Message.{dtor}(Message* )
    at qpid.messaging.Message.__delDtor(Message* , UInt32 )
    at Org.Apache.Qpid.Messaging.Message.Cleanup()
    at Org.Apache.Qpid.Messaging.Message.!Message()
    at Org.Apache.Qpid.Messaging.Message.Dispose(Boolean )
    at Org.Apache.Qpid.Messaging.Message.Finalize()

Also, the output from the broker suggests that the queue /has /been created:

2010-08-11 09:44:37 info Queue 
"9224f93b-8c4b-4675-bc04-61e721387140#reply": Policy created: 
type=reject; maxCount=0; maxSize=104857600
2010-08-11 09:44:37 error Execution exception: not-found: Exchange not 
found: 9224f93b-8c4b-4675-bc04-61e721387140#reply 
(..\..\qpid\cpp\src\qpid\broker\ExchangeRegistry.cpp:92)

Can anyone explain what I am doing wrong here? Or is this a bug?

Thanks,
Chris


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message