Hi folks,

I'm trying to build a client for a rabbitmq broker.
The client should send messages.

I'm following the examples like
https://github.com/apache/qpid-proton/blob/master/cpp/examples/simple_send.cpp

My software stack is:
Debian stable with package libqpid-proton-cpp12 Version 0.22.0
g++ --version: g++ (Debian 8.3.0-6) 8.3.0


My problem:
With the code below I can connect successfully to rabbitmq, but the
user is always the default one (guest). When I change the queue name
from "checkermq" to something else the queue is created also
successfully.

The code doesn't seem to accept the user and password, which I have
defined in user and credentials. The user / password exists on the
broker of course. 

* What do I miss here?


Regards,
Alexander



My code so far (the relevant parts only)
There isn't much more actually. I'm still in the "exploring phase")
But from my understanding this should be enough for the login with a
different user.

header file

class listener : public proton::messaging_handler
{
...
};

code file:

listener::listener (std::string servername, std::string port,
std::string user, std::string credentials) : m_servername (servername),
m_port (port), m_user (user), m_credentials (credentials) { }

void listener::on_container_start (proton::container &c)
{
  proton::connection_options co;
  m_url = m_servername + ":" + m_port + "/checkermq";
  co.user (m_user);
  co.password (m_credentials);
  co.sasl_enabled (true);
  m_sender = c.open_sender(m_url, co);
}

In the main.cpp I start it with

 listener l (servername, port, user, credentials);
 proton::container(l).run ();

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to