Announcement Announcement Module
Collapse
No announcement yet.
Sorry for the noob question Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sorry for the noob question

    Ok, I can't get through this so I humbly ask for your help.
    I deployed rabbitmq on a machine
    rabbitmq is working because I can use rabbitmqctl and I have access through the web management plugin ... so that is OK

    Oh I'm using Linux systems by the way.

    So I have tried to configure Spring to make a basic test ... I mean real basic.

    Let me show you

    ==== Spring ====

    <bean id="connectionFactory"
    class="org.springframework.amqp.rabbit.connection. CachingConnectionFactory">
    <constructor-arg value="data-desktop"/>
    <property name="username" value="user"/>
    <property name="password" value="passwd"/>
    <property name="virtualHost" value="vhost"/>
    </bean>

    ==== Groovy File ====

    import com.rabbitmq.client.Channel
    import com.rabbitmq.client.AMQP
    import com.rabbitmq.client.AMQP.BasicProperties

    import org.springframework.amqp.rabbit.connection.Connect ion
    import org.springframework.amqp.rabbit.connection.Connect ionFactory
    import org.springframework.amqp.core.ExchangeTypes

    log.info "Connection test logging message"
    ConnectionFactory connf = ctx.getBean("connectionFactory")
    Connection conn = connf.createConnection()
    Channel chan = conn.createChannel(true)
    String message = "Yet another message!"
    chan.queueDeclare("rqqueue", true, false, false, null)
    chan.exchangeDeclare("rqexchange", ExchangeTypes.DIRECT, true)
    chan.queueBind ("rqqueue","rqexchange","rqbind_rkey")
    chan.basicPublish("rqexchange",
    "rqbind_rkey",
    new AMQP.BasicProperties.Builder()
    .contentType("text/plain").deliveryMode(2)
    .priority(2)
    .build(),
    message.getBytes())
    log.debug(" [x] Sent {}",message)
    chan.close()
    conn.close()

    As you see I am not using spring objects everywhere but I don't think that's my problem.

    The problem is that I don't see anything comming in the "rqqueue" in my rabbitmq system;
    When I create messages from the Web interface it works
    I see my app connecting in rabbitmq logs (though they do not report any message creation)
    I see the end of the connection
    Then ... zip ... nada ... nothing.

    And no exception reports.
    I don't even get an exception on the basicPublish, which would be kind of nice ... if I saw my message at the other end

    So ... well I'm not sure what is happenning but I was sort of expecting that the presence of messages would be visible in the queue.

    Any leads are welcome.

  • #2
    OK, so it WAS a dummy question :$

    Channel chan = conn.createChannel(true)

    works better like that

    Channel chan = conn.createChannel(false)

    Now I need to make sure I understand the transaction part.

    Comment

    Working...
    X