Hello all,

   Writing you regarding connection problem with Azure Service Bus
using Qpid Proton.

First of all I downloaded Qpid Proton 0.18.1 version and successfuly
built it via MS VS 17.
Tried if it's working fine by running several example programs
(successfuly sent HelloWorld msg to proton's default broker).

Finally I tried to send the same HelloWorld msg. to the Azure Service Bus Queue.
==========================================================================
Source code:

class hello_world : public proton::messaging_handler
{
std::string conn_url_;
std::string addr_;

public:
hello_world(const std::string& u, const std::string& a) :
conn_url_(u), addr_(a)
{
std::cout << "\nhello_world called\n";
}

void on_container_start(proton::container& c) OVERRIDE
{
std::cout << "\non_container_start called\n";
c.connect(conn_url_);
}

void on_connection_open(proton::connection& c) OVERRIDE
{
std::cout << "\non_connection_open called\n";
c.open_receiver(addr_);
c.open_sender(addr_);
}

void on_sendable(proton::sender &s) OVERRIDE
{
proton::message m("Hello World!");
s.send(m);
s.close();
}

void on_message(proton::delivery &d, proton::message &m) OVERRIDE
{
std::cout << m.body() << std::endl;
d.connection().close();
}
};

int main(int argc, char **argv) {
try
{
std::string sb_namespace = "namespacename.servicebus.windows.net";
std::string sb_key_name   = "PartitionedQueuePolicyName";
std::string sb_key              = "urlEncodedSBQueuePrimaryKey";
std::string sb_entity           = "igorshelestnotpartitionedqueue";

std::string connection_string = "amqps://" + sb_key_name + ":" +
sb_key + "@" + sb_namespace + ":5672/" + sb_entity;

hello_world hw(connection_string, sb_entity);
proton::container container(hw);
container.run();

std::cout << "\nSuccessful exit\n;";
system("pause");
return 0;
}
catch (const std::exception& e) {
std::cerr << "\nException:" << e.what() << "\n" << std::endl;
}

std::cout << "\nUnsuccessful exit\n";
system("pause");
return 1;
}
==========================================================================

As a result the following output is received:
==========================================================================
hello_world called
on_container_start called[00CB1200]:  -> SASL
[00CB1200]:  <- SASL
[00CB1200]:0 <- @sasl-mechanisms(64)
[sasl-server-mechanisms=@PN_SYMBOL[:MSSBCBS, :PLAIN, :ANONYMOUS,
:EXTERNAL]]
[00CB1200]:0 -> @sasl-init(65) [mechanism=:EXTERNAL,
initial-response=b"IgorShelestNotPartitionedQueuePolicyName"]
[00CB1200]:0 <- @sasl-outcome(68) [code=0, additional-data=b"Welcome!"]
[00CB1200]:  -> AMQP
[00CB1200]:0 -> @open(16)
[container-id="41155a12-3703-475c-8063-d61b8f3de514",
hostname="igorshelestnamespacename.servicebus.windows.net",
max-frame-size=10000, channel-max=32767, idle-time-out=500]
[00CB1200]:0 -> @close(24) [error=@error(29) [condition=:"proton:io",
description="An existing connection was forcibly closed by the remote
host.  - on read from
igorshelestnamespacename.servicebus.windows.net:5672 (AMQP header
mismatch: Insufficient data to determine protocol [''] (connection
aborted))"]]
[00CB1200]:  <- EOS

Exception:▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌


Unsuccessful exit
==========================================================================

I tried to google what the problem, didn't really find any solution.
As far as I understand some connection options are probably wrong.
Do you have any idea how to fix this issue?

Thanks a lot in advance.
Best Regards

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org

Reply via email to