AMQP connection creation issue

Feb 12, 2015 at 10:47 AM
Edited Feb 12, 2015 at 10:48 AM
Hi,
I downloaded amqpnetlite 0.1.1 beta version code and running on VS-2013.
i got issue when creating socket connection.


Address address = new Address("amqps://owner:8upNzF2Q3WukzqC5e1OhWg0srIbXYpyMUPFcHwqXPAY%3d@testeventname.servicebus.windows.net/in/t0001"); Please let me know how i will configure parameter of address constructor. Please expalin me in detail i am not having any idea about password prperty of address.

Please also let me know one more thing is it possible to run with VS2013, any hardware is required or not?
```
Editor
Feb 12, 2015 at 10:52 AM
Hi,

what's the issue ?

Thanks,
Paolo.
Feb 12, 2015 at 11:20 AM
Hi Paolo,
Thanks for quick reply.

I want to implement Azure service bus(Event HUB,Topic, Subscription) in .Net microFramework with VS-2013 please provide me any sample example.


Thanks
Shreyansh
Editor
Feb 12, 2015 at 12:32 PM
You can fine more examples in the documentation section :

http://amqpnetlite.codeplex.com/documentation

You can compile them on .Net Micro Framework too.
Remember that you need a board with SSL support (for example, FEZ Spider and FEZ Raptor from GHI ... Netduino doesn't support it)

Paolo
Feb 13, 2015 at 3:59 AM
Hi Paolo,

I have developed a .net microframework Project that send messages to azure service bus topics and subscription using RESTAPI. But now I want to implement subscrtiptionClient onMessage (like message pump in .net azure service bus sdk ).My scenario is if any one send message to subscription so my machine will receive a notification that some one send message to service bus subscription.
I am using visual studio 2013 .net microframework console application


~Thanks
Abhinav
Feb 13, 2015 at 6:24 AM
Hi,

Please let me know how i will create Address object using given example end point.

Endpoint=sb://testing.servicebus.windows.net/;SharedAccessKeyName=MyTestSendKey;SharedAccessKey=5/B4HoMxh4CLDjAEPF8T0r3dKJouJ/9Q+TUEBZrw9Qz=


Address address = new Address("amqps://<user>:<key>@<namespace_base_uri>");
My created Address object is given below but it's not working.

Address address = new Address("amqps://MyTestSendKey:5/B4HoMxh4CLDjAEPF8T0r3dKJouJ/9Q+TUEBZrw9Qz=@testing.servicebus.windows.net");


Please create a proper Address object from given end point and let me know how i will create encoded key.

Thanks
Shreyansh
Coordinator
Feb 13, 2015 at 5:08 PM
The key name and key need to be URL encoded as follows:
Address address = new Address("amqps://MyTestSendKey:5%2FB4HoMxh4CLDjAEPF8T0r3dKJouJ%2F9Q%2BTUEBZrw9Qz%3D@testing.servicebus.windows.net");

Or you can create the Address object by specifying individual parameters:
Address address = new Address("testing.servicebus.windows.net", 5671, "MyTestSendKey", "5/B4HoMxh4CLDjAEPF8T0r3dKJouJ/9Q+TUEBZrw9Qz=", "amqps");

In the first case, the URL encoding is needed because there might be reserved characters ('/', '@') in your key name or value and that could break the URL parsing. This constructor is intended to make config easier (e.g. you could store the connection string as just one string item).

Thanks,
Xin
Feb 16, 2015 at 4:04 AM
Edited Feb 16, 2015 at 11:35 AM
Hi Xin,
Thanks for your reply...

I am using below code(without any device running project in VS Micro framework) for sending data to azure its working fine but when i go to Azure portal unable to see any record. Please correct me if something is wrong.
        Address address = new Address("testing.servicebus.windows.net", 5671, "MyTestSendKey", "5/B4HoMxh4CLDjAEPF8T0r3dKJouJ/9Q+TUEBZrw9Qz=", "amqps"); 
        Connection amqpConnection = new Connection(add);

        var amqpSession = new Session(amqpConnection);

        SenderLink amqpSender = new SenderLink(amqpSession,
               "send-link/in/t0000", // unique name for all links from this client 
               "/in/t0000"); // Service Bus entity name 

        var message = new Message();
        message.Properties = new Properties();
        message.Properties.Subject = "mymessagetype";
        message.ApplicationProperties = new ApplicationProperties();
        message.ApplicationProperties["MyProperty"] = "Hello World!";
        amqpSender.Send(message);
Please explain 2nd and 3rd parameter of SenderLink. What is send-Link,in and t000?
                SenderLink amqpSender = new SenderLink(amqpSession,
               "send-link/in/t0000", // unique name for all links from this client 
               "/in/t0000"); // Service Bus entity name     
  • I am not having any SSL supported device please let me know is it possible to run this code without SSL support device?
Thanks
Shreyansh
Editor
Feb 17, 2015 at 7:31 AM
Hi,

the 2nd parameter ("send-link/in/t0000") is simply an identifier name for the link and the 3rd ("/in/t0000") is the entity that already exists in the service bus namespace. It could be a queue, a topic or an event hub (for a sender).
What do you mean that you can't see any record in the portal ? Does the "/in/t0000" entity exist in your service bus namespace ?
To see messages send and/or receive to/from entities in service bus you can use the Service Bus Expolorer here : https://code.msdn.microsoft.com/windowsapps/Service-Bus-Explorer-f2abca5a

The connection to Service Bus is only possible using SSL.

Paolo.