Hi Gordon,

Thanks for your reply.

I have tried with sender and receiver address format provided in RabbitMQ
AMQP 1.0 readme file, still CreateSender address not working, for few
address format thrown exception, and sometime not data not written to Queue.

Please find the below snippet I used for testing.

 try {
        Connection connection(broker, connectionOptions);
        connection.open();
        Session session = connection.createSession();
        
                */*
                I wanted to set
                Sender Address
                | "/exchange/"  X         Publish to exchange X with message 
subject as
routing key

                Receiver Address
                | "/topic/"     RK        Consume from temp queue bound to 
amq.topic with
routing key RK
                */*
                
                //Sender sender = session.createSender("'/topic/'");  *//didnot 
work
Exception thrown Session ended by peer with amqp:invalid-field: Attach
rejected: {invalid_destination,topic,"/"}*
                ///Sender sender = session.createSender("'/topic/usa.news'"); 
//*works/*
                Sender sender = session.createSender("'/exchange/topic'"); *// 
didnot
work, Receiver fetch thrown exception, no message to fetch*
                Receiver receiver = session.createReceiver("'/topic/#.news'");
*///creating temp queue with routing key #.news/*

                Message message;
                message.setContentObject("Hello world!");
                message.getContentObject().setEncoding("utf8");

                message.setSubject("'usa.news'");
                sender.send(message);

                message = receiver.fetch(Duration::SECOND * 1);
                std::cout << message.getContent() << std::endl;

                session.acknowledge();
        connection.close();
        return 0;
    } catch(const std::exception& error) {
        std::cerr << error.what() << std::endl;
        return 1;
    }

Thanks,
Mohan



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

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

Reply via email to