Announcement Announcement Module
Collapse
No announcement yet.
amqp:inbound-channel-adapter not reading data from queue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • amqp:inbound-channel-adapter not reading data from queue

    Hi Friends,

    i am working on spring-amqp sample application.
    I am able send messages to rabbitmq queue using outbound-channel-adaptor.(able to see in server)
    not able to receive messages from queue using inbound-channel-adaptor. and there is no errors(Exceptions)

    here i giving config snip.

    for sending
    .................................................. .....................

    <int-amqp:outbound-channel-adapter routing-key="ticket.queue" amqp-template="amqpTemplate" channel="ticketChannel" />



    for Receiving
    .................................................. .....................

    <int:channel id="receiveChannel"/>
    <int:service-activator input-channel="receiveChannel" ref="ticketReceiver"/>

    <int-amqp:inbound-channel-adapter channel="receiveChannel"
    queue-names="ticket.queue" connection-factory="connectionFactory" acknowledge-mode="AUTO"/>

  • #2
    Which exchange are you sending to? Can you show the configuration for your amqpTemplate?

    Comment


    • #3
      Hi dave , thanks for your concern

      here i am giving configuration class, i am using default exchange

      @Configuration
      public class RabbitmqConfiguration {
      @Bean
      public SingleConnectionFactory connectionFactory() {
      SingleConnectionFactory connectionFactory = new SingleConnectionFactory("172.20.104.64");
      connectionFactory.setPort(5672);
      connectionFactory.setUsername("guest");
      connectionFactory.setPassword("guest");
      return connectionFactory;
      }

      @Bean
      public RabbitTemplate amqpTemplate() {
      RabbitTemplate rabbitTemplate = new RabbitTemplate();
      rabbitTemplate.setConnectionFactory(connectionFact ory());
      rabbitTemplate.setRoutingKey("ticket.queue");
      rabbitTemplate.setQueue("ticket.queue");
      return rabbitTemplate;
      }
      @Bean
      public RabbitAdmin rabbitAdmin() {
      RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory());
      return rabbitAdmin;
      }
      @Bean
      public Queue ticketQueue() {
      Queue queue = new Queue("ticket.queue");
      return queue;
      }
      @Bean
      public MessageChannel ticketChannel() {
      MessageChannel channel = new DirectChannel();
      return channel;
      }
      }
      Last edited by gopithumati; Dec 16th, 2011, 03:08 AM. Reason: attaching src code

      Comment

      Working...
      X