Results 1 to 4 of 4

Thread: Problems when sending a message while receiving using RabbitMQ / RabbitTemplate

Threaded View

  1. #1
    Join Date
    Jul 2010
    Posts
    4

    Default Problems when sending a message while receiving using RabbitMQ / RabbitTemplate

    HI there i am trying to send a message in the handleMessage method,
    this seems to fail somehow. Is there a reason why i cannot send a
    message to rabbitMQ when processing/receiving a message?

    Code:
    // receives a message and replies to the reply queue
    void handleMessage(Message message) {
    
        // send a message to the exchange and waits for the reply..
        String result =
    rabbitTemplate.convertSendAndReceive("myCustomExch", "myRoutingKey",
    "test content")
    
        // determine the reply queue
        def destQueue = message.messageProperties.replyTo
    
        // code omitted that processes the message and uses the previously result
        ....
    
        // send the content back to the reply queue
        rabbitSend destQueue, responseJson
    }
    When i put the rabbitTemplate.convertSendAndReceive("myCustomExch ",
    "myRoutingKey", "test content") method in a non handleMessage method
    it works without problems. Am i not allowed to send and receive inside
    a handleMessage method that is also handling stuf?

    /Marco
    Last edited by marcopas; Feb 22nd, 2013 at 08:43 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •