Dear all,
Sorry to disturb you. I am new to Qpid.
When I tried to write a simple sender and receiver by splitting the HelloWorld
example in Qpid cpp 1.36. I met memory problem.
HelloWord1 is responsible receiving data as below:
Connection connection(broker, connectionOptions);
connection.open();
Session session = connection.createSession();
Receiver receiver = session.createReceiver(address);
while (true)
{
Message message;
message.setContentObject("Hello world!");
message.getContentObject().setEncoding("utf8");
// sender.send(message);
message = receiver.fetch(Duration::FOREVER);
std::cout << message.getContent() << std::endl;
session.acknowledge();
}
connection.close();
HelloWorld2 is responsible sending data as below:
Connection connection(broker, connectionOptions);
connection.open();
Session session = connection.createSession();
Sender sender = session.createSender(address);
for (int i = 0; i < 500000000; i++)
{
Message message;
message.setContentObject("Hello world!");
message.getContentObject().setEncoding("utf8");
sender.send(message);
}
connection.close();
And I use Java qpid-broker-6.1.1 as broker.
I saw the both processes HelloWord1.exe and HelloWorld2.exe memory usage
increase quickly.
Am I using the Qpid in a wrong way? Maybe I am too stupid. Can anyone help? :-(
The two cpp files are attached...
Thanks,
Frank.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]