[rabbitmq-discuss] Sorry for the noob question :$
Michel Kapel
mkirbsn at gmail.com
Tue Aug 7 14:25:27 BST 2012
Ok, I'm not getting out of this so I humbly ask for your help.
I Am programming in Groovy and I am trying to use rabbitmq.
I have set up a small test program using Spring
Since I had little success I reduced all the Spring stuff to almost
nothing so I guess it does not hav muche to do with it.
Basically the rabbitmq is deployed and it works.
I can tell that from the rabbitmqctl but also from the Web interface
plugin which shows me the queues and settings.
The Test starts OK and I get no Exception
The problem is I get nothing in my queue "rqqueue" from virtualhost either.
I can see theconnection in the rabbitmq logs but no publishing.
But If I publish something myself from the WebApp, it works ...
Any idea is welcome.
==== 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.Connection
import org.springframework.amqp.rabbit.connection.ConnectionFactory
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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mkirbsn.vcf
Type: text/x-vcard
Size: 280 bytes
Desc: not available
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120807/41fdd451/attachment.vcf>
More information about the rabbitmq-discuss
mailing list