node.js - .Net AMQP client for IBM MQ -


i trying connect ibm mq 9.0 using amqp 1.0 channel .net application.

the mq light portal supports nodejs, ruby, java , python clients only. have mq light amqp client .net?

i have tried connecting ibm mq 9 amqpnetlite client

namespace amqpnetlitesample {     class program     {         static void main(string[] args)         {             console.writeline("start");             //address addr = new address("10.58.139.97", 1234, "username","password", "/", "amqp");             address addr = new address("amqp://10.58.139.97:1234");              connection con = new connection(addr);             con.closed += con_closed;             console.writeline("created connection");              session session = new amqp.session(con);             session.closed += session_closed;             console.writeline("created session");              senderlink link = new senderlink(session, "sender_12565455877", "/public");             console.writeline("created link");             var message = new message();             message.properties = new properties();             message.properties.subject = "mysamplemsg";             message.applicationproperties = new applicationproperties();             message.applicationproperties["myprop"] = "hello world";             console.writeline("sending message");             link.send(message);          }          static void session_closed(amqpobject sender, error error)         {             console.writeline("session closed");             console.writeline(error.tostring());         }          static void con_closed(amqpobject sender, error error)         {             console.writeline("connection closed");             console.writeline(error.tostring());         }     } } 

but not succeed in establishing connection. when initiating senderlink, getting 2035 mqrc_not_authorized exception. however, without changing of channel authentication in ibm mq 9.0 server, if try mq light nodejs example (send.js), able connect , send messages amqp channel.

please suggest if there changes required in above code.

has succeeded in establishing communication ibm mq other .net 1.0 amqp clients? need here. thanks.

it seems when user name , password not configured, mq broker requires sasl negotiation connection. can enable sasl anonymous on amqpnetlite follows.

address address = new address("amqp://10.58.139.97:1234"); connection connection = new connection(address, saslprofile.anonymous, null, null); session session = new session(connection); senderlink sender = new senderlink(session, "sender-12345", "/public"); message message = new message("hello"); message.properties = new properties() { messageid = "msg", = "q1" }; sender.send(message); connection.close(); 

it possible same connectionfactory.

address address = new address("amqp://10.58.139.97:1234"); var factory = new connectionfactory(); factory.sasl.profile = saslprofile.anonymous; connection connection = await factory.createasync(address); 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -