RabbitMQ

AMQP-CPP - RabbitMQ Event Loop is not working

廉价感情. 提交于 2020-01-06 04:09:45
问题 I dont get the Event Loop with the RabbitMQ CPP (CopernicaMarketingSoftware/AMQP-CPP) Library from https://github.com/CopernicaMarketingSoftware/AMQP-CPP running properly. I have set up a rabbitmq server, and it works fine. My code looks like this: #include <iostream> #include <sys/select.h> #include <cop_amqpcpp.h> #include <cop_amqpcpp/linux_tcp.h> using namespace std; fd_set rfds; class MyTcpHandler : public AMQP::TcpHandler { private: /** * Method that is called when the connection

Avoid automatic binding with RabbitMQ and Camel

萝らか妹 提交于 2020-01-06 02:40:10
问题 I'm trying to use RabbitMQ with Camel. I am using Camel 2.14.1. I want to open an fanout exchange on RabbitMQ and then later bind queues to it. This seems to work fine. However, everytime I create an Exchange, it is automatically bound to queue with a system name (a number). Can't I avoid that? Here is a simple example which posts 100 messages to an Exchange. But they get delivered to an automatically created queue, I want to avoid this. @Override public void configure() throws Exception {

How do I configure rabbitmq queue via puppet

◇◆丶佛笑我妖孽 提交于 2020-01-06 02:00:27
问题 I'm trying to install rabbitmq via puppet. I'm using the puppetlabs-rabbitmq module. It also has section to configure queues and exchanges, which are Native Types . I can't figure out how to use these native types. My code for rabbitmq installation: class rabbitmq-concrete{ $tools = ["vim-enhanced","mc"] package { $tools: ensure => "installed" } $interface = "enp0s8" $address = inline_template("<%= scope.lookupvar('::ipaddress_${interface}') -%>") class { 'rabbitmq': config_cluster => true,

What is the ServletFilter equalent of a RabbitMq Listener?

♀尐吖头ヾ 提交于 2020-01-06 01:34:28
问题 I have a spring-boot web application for which I implemented an MDCFilter that adds a UUID to MDC logging context that i can find in the log file. The Filter class looks like this. public class MDCFilter implements Filter { @Override public void init(FilterConfig filterConfig) { } @Override public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { String requestId = UUID.randomUUID().toString(); MDC.put(REQUEST_ID_KEY, requestId);

In RabbitMQ how to consume multiple message or read all messages in a queue or all messages in exchange using specific key?

て烟熏妆下的殇ゞ 提交于 2020-01-05 12:08:23
问题 I want to consume multiple messages from specific queue or a specific exchange with a given key. so the scenario is as follow: Publisher publish message 1 over queue 1 Publisher publish message 2 over queue 1 Publisher publish message 3 over queue 1 Publisher publish message 4 over queue 2 Publisher publish message 5 over queue 2 .. Consumer consume messages from queue 1 get [message 1, message 2, message 3] all at once and handle them in one call back listen_to(queue_name , num_of_msg_to

rabbitmq ReturnCallback stuck while declaring queue on NO_ROUTE(312)

笑着哭i 提交于 2020-01-05 06:26:10
问题 I am trying to use the publisher returns callback to declare queue and bindings if no route is available so that messages aren't dropped again. This is because my queue is auto-delete and would be deleted if my consumer goes down. But the ReturnCallback thread gets stuck in returnedMessage() at admin.declareQueue(queue). On Further debugging I see that it is stuck in RabbitAdmin.declareQueue() at: DeclareOk[] declared = declareQueues(channel, queue); Though this call is stuck, I see the queue

Cannot connect to RabbitMQ Server from remote machine (Android device)

烈酒焚心 提交于 2020-01-05 04:25:24
问题 I've started RabbitMQ server on my local machine (Windows 10). Management panel on localhost:5672 is working well. I've established new user and wrote example project in java for sending and receiving. It works well with localhost and with my ip address for new established user: Unfortunately i've written the same configuration in my Android project and error appears: 12-27 00:42:04.601 4393-4393/com.gornik.sendsensors E/AndroidRuntime: FATAL EXCEPTION: main Process: com.gornik.sendsensors,

RabbitMQ - How to check if queue is empty?

本小妞迷上赌 提交于 2020-01-04 17:08:31
问题 I have a web service interface that abstracts a RabbitMQ server (don't ask me why, I know it's an unnecessary step, but I have to). That is, I poll messages from the queue through a web service call, not directly over amqp . Consuming via basic.consumer blocks the execution thread till there are messages in the queue. This makes the web service not return. Code for illustration: $connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest'); $channel = $connection->channel();

RabbitMQ SSL giving handshake failure when using SpringAMQP

╄→гoц情女王★ 提交于 2020-01-04 14:01:25
问题 I have rabbitMQ installed using the following configuration [ {rabbit, [ {ssl_listeners, [5671]}, {ssl_options, [{cacertfile,"C:\\dev\\rabbitcert\\testca\\cacert.pem"}, {certfile,"C:\\dev\\rabbitcert\\server\\cert.pem"}, {keyfile,"C:\\dev\\rabbitcert\\server\\key.pem"}, {verify,verify_peer}, {fail_if_no_peer_cert,false}]} ]} ]. And i am Instantiating the Connection Factory as such (data replaced with dummy): private static ConnectionFactory getConnectionFactoryForQueue(){ com.rabbitmq.client

How to publish messages on RabbitMQ with fanout exchange using Spring Boot

我与影子孤独终老i 提交于 2020-01-04 06:32:28
问题 I have the following piece of code that publishes messages onto RabbitMQ queues using fanout exchange . The exchange is getting created but the message cannot be see in RabbitMQ queues. I am not seeing any error either. BasicApplication.java @SpringBootApplication public class BasicApplication { public static final String QUEUE_NAME_1 = "helloworld.fanout.q1"; public static final String QUEUE_NAME_2 = "helloworld.fanout.q2"; public static final String EXCHANGE_NAME = "helloworld.fanout.x"; /