question
stringlengths
11
28.2k
answer
stringlengths
26
27.7k
tag
stringclasses
130 values
question_id
int64
935
78.4M
score
int64
10
5.49k
In Git I can use an interactive rebase to re-write history, this is great because in my feature branch I made a ton of commits with partially working code as I explored different refactors and ways of getting it done. I'd like to squash a lot of the commits together before rebasing or merging the branch onto master. So...
You either need to also reorder the commits so the to-be-kept commit comes before the to-be-squashed commits if this is feasible. (For an alternative, see the update at the end of the answer) If this is not feasible, because you then would get conflicts you don't want to resolve, just make it 1. pick 2. squash 3. squas...
Squash
44,210,747
20
I have a large number of commits, about 20, that I've done since my last push to origin/master. I have never had more than one branch, master, and all commits were done on master. How can I squash all 20 commits into one commit, preferably using sourcetree? I want to do this so I can just push one commit to origin/m...
Easier solution (than a rebase): Select the "origin/master" commit in the log entry, click on "Reset <branch> to this commit". Use the default mixed mode. Then add and commit: all your changes will be registered again in one new commit, that you will be able to push. See git reset Demystified for more.
Squash
25,102,750
16
I use an optimistic work-flow in Gitlab, which assumes the majority of my merge requests will be accepted without change. The flow looks like this: Submit a merge request for branch cool-feature-A Create a new branch, based on cool-feature-A, called cool-feature-B. Begin developing on this branch. A colleague approves...
Essentially, you have to tell Git: I want to rebase cool-feature-B against master, but I want to copy a different set of commits than the ones you'd normally compute here. The easiest way to do this is going to be to use --onto. That is, normally you run, as you said: git checkout cool-feature-B git rebase master b...
Squash
56,804,649
15
My work flow: branch from master work in my branch, commit frequently (100+) when the job is done in my branch, merge master into my branch, resolve all the conflict. CODE REVIEW TIME before merging back to master For CODE REVIEW, I need to show the differences between two heads and squash/organize my commits ( in ab...
The Sourcetree free Git GUI for Windows and Mac supports this. Alternatively, to do it without a GUI, you can run git rebase --interactive --autosquash because you committed with commit message beginning with !squash (when those intermediate commits were about the same task) See "Trimming GIT Checkins/Squashing GIT ...
Squash
7,694,911
13
My history looks somewhat like this but times 10: i - j - e'- k - h'- l - m feature-branch / a - b - c - d - e - f - g - h master (the apostrophes meaning cherry picks) I want to rebase to this: i - j - k - l - m feature-branch ...
This is actually quite easy. Merge master into feature-branch. You will solve all of your merge conflicts here at once. (I highly recommend stopping here.) i - j - e'- k - h'- l - m - n feature-branch / / a - b - c - d - e - f - g - h -------- master Then, gi...
Squash
30,197,694
13
When doing a normal merge, e.g. git merge <branch>, git creates a merge commit and updates the HEAD of the current branch to that commit. When doing a squash merge, e.g. git merge <branch> --squash, however, it does not make a commit, saying (on a clean merge): Squash commit -- not updating HEAD Automatic merge went we...
What's the rationale behind this? The draft merge commit message will contain all your squashed messages from the other branch. Something like this: Squashed commit of the following: commit 2fb77b77f813501ae2c8159e7bf751c216572a57 Author: Your Name <you@example.com> Date: Tue May 22 22:47:50 2018 +0200 Drop b...
Squash
50,475,519
12
I have a lot of commits that I want to squash together into one commit. Of course I may replace pick with squash for every commit, but I have a hundreds commits. Is there a way to do this automatically?
If you have a sequence of commits ... - C1 - C2 - C3 - C4 - C5 <- HEAD and you want to squash C2 to C5 into a single commit, you can reset your branch to C1 while keeping the state of your working directory and staging area, ans then commit again: git reset --soft C1 git commit This will require you to re-enter a com...
Squash
28,218,410
11
I am using git subtree to organize my git repositories. Let's say I have a main repository called repo and a library called lib. I successfully "imported" the lib repository by squashing its history. I would now like to contribute back to lib by squashing the history too. This does not seem to work: I specify the --squ...
It is possible that this is an error in the documentation of the subtree command. The manual in git states: options for 'add', 'merge', 'pull' and 'push' --squash merge subtree changes as a single commit If you check the more extended documentation in the original subtree project you will notice that ...
Squash
20,102,594
10
Most CI services provide a way to shallow clone a repository. For example, on Travis: git: depth: 1 or on AppVeyor: clone_depth: 1 or shallow_clone: true This has the obvious benefit of speed, since you don't have to clone the whole repository. Is there any disadvantages to shallow cloning on CI services? Is there...
There's two reasons why it doesn't usually happen. Firstly, the hash of a shallow clone is going to be different from any version that you may have in the repository. As a result, it's not going to be possible to track a build that you've done to any particular result. Secondly most Git servers have the ability to send...
Appveyor
31,278,233
17
Is it possible to use AppVeyor as a Windows Qt continuous integration service?
Qt is preinstalled on all configurations. See http://www.appveyor.com/docs/installed-software#qt Here is an example script for appveyor.yml : install: - set QTDIR=C:\Qt\5.5\mingw492_32 - set PATH=%PATH%;%QTDIR%\bin;C:\MinGW\bin build_script: - qmake QtTest.pro - mingw32-make Supported compiler environments are...
Appveyor
26,586,006
15
Follow up from this question, I'm currently setting up AppVeyor for my project (here) and my .NET Core tests are only shown in the console output but not in the Tests window. This is the link for the AppVeyor project: ci.appveyor.com/project/Sergio0694/neuralnetwork-net If some tests fail, the console correctly shows a...
Please add https://www.nuget.org/packages/Appveyor.TestLogger to your test projects.
Appveyor
48,235,374
10
I have seen a lot of examples on the internet of chats using web sockets and RabbitMQ (https://github.com/videlalvaro/rabbitmq-chat), however I do not understand why it is need it a message queue for a chat application. Why it is not ok to send the message from the browser via web sockets to the server and then the se...
i don't think RabbitMQ should be used for a chat room, personally. at least, not in the "chat" or "room" part of the application. unless your chat rooms don't care about history at all - and i think most do care about that - a message queue like RMQ doesn't make much sense. you would be better off storing the message i...
RabbitMQ
39,122,247
17
I am using a RabbitMQ producer to send long running tasks (30 mins+) to a consumer. The problem is that the consumer is still working on a task when the connection to the server is closed and the unacknowledged task is requeued. From researching I understand that either a heartbeat or an increased connection timeout ...
I've run into the same problem with my systems, that you are seeing, with dropped connection during very long tasks. It's possible the heartbeat might help keep your connection alive, if your network setup is such that idle TCP/IP connections are forcefully dropped. If that's not the case, though, changing the heartbe...
RabbitMQ
36,123,006
17
I am starting to use celery by following this "First Steps with Celery". I exactly used the tasks.py indicated on that link. However when I ran the task using, celery -A tasks worker --loglevel=info I am getting this error: [2014-09-16 20:52:57,427: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0....
I was able to resolve this (for those who have and will have the same issue) by doing the following. I recreated the user I mentioned on my question, but this time with a password. Like this: sudo rabbitmqctl add_user jm-user1 sample Then I set the permissions again with this: sudo rabbitmqctl set_permissions -p jm-vh...
RabbitMQ
25,869,858
17
I am running RabbitMQ v3.3.5 with Erlang OTP 17.1 on Windows 2008 R2. My Dev and QA environments are stand-alone. My staging and production environments are clustered. I am finding this one problem happening often where the RabbitMQ service is running, the RabbitMQ management console is seeing everything, but when I ...
Hostnames are case-insensitives when you are trying to resolve them. For example, LOCALHOST and localhost are the same host. However, when Erlang constructs the name of a node (eg. rabbit@<hostname> in the case of RabbitMQ), this name is case-sensitive. So rabbit@LOCALHOST and rabbit@localhost are two different node na...
RabbitMQ
25,409,626
17
I've installed rabbitmq and it's running. I've successfully add_user as well as add_vhost. But in the next step of the documentation it says to set_permissions and I'm failing. I get Error: could not recognise command when I enter the following: $ sudo rabbitmqctl set_permissions -p myvhost myuser ".*" ".*" ".*" (this...
From the documentation set_permissions [-p vhostpath] {user} {conf} {write} {read} vhostpath - The name of the virtual host to which to grant the user access, defaulting to /. user - The name of the user to grant access to the specified virtual host. conf - A regular expression matching resource names for which the u...
RabbitMQ
24,639,448
17
My container XML config: <rabbit:listener-container connection-factory="myConnectionFactory" acknowledge="none" concurrency="10" requeue-rejected="false"> <rabbit:listener ref="myListener" queues="myQueue"/> </rabbit:listener-container> and myListener is just a class @Component("myL...
Yes, to use concurrency, your listener has to be thread-safe. There is one listener instance per container. However, the <rabbit:listener-container/> namespace element is actually just a convenience for adding "shared" attributes, each listener element gets its own container. It's generally best to use stateless object...
RabbitMQ
23,341,811
17
I've used docker to start my rabbitmqserver. How can I use rabbitmqctl to connect to the rabbitmqserver in the docker container? Port 5672 has been exposed and map to the 5672 port of my host. But I still get the following error: Status of node rabbit@m2 ... Error: unable to connect to node rabbit@m2: nodedown
Assuming your container is called rabbitmq and is running: docker exec rabbitmq rabbitmqctl start_app
RabbitMQ
20,345,658
17
ConnectionFactory factory = new ConnectionFactory {HostName = "localhost"}; using (IConnection connection = factory.CreateConnection()) using (IModel channel = connection.CreateModel()) { channel.QueueDeclare("hello", false, false, false, null); for (int i = 0; i < 100000; i++) { MemoryStream strea...
IConnection is thread safe, IModel is not. Generally you should endeavour to keep a connection open for the lifetime of your application. This is especially true if you have consumers which need an open connection in order to receive messages. It's important to detect and recover from interrupted connections, either be...
RabbitMQ
12,024,241
17
I'm using Pika to process data from RabbitMQ. As I seemed to run into different kind of problems I decided to write a small test application to see how I can handle disconnects. I wrote this test app which does following: Connect to Broker, retry until successful When connected create a queue. Consume this queue and p...
The main problem with your script is that it is interacting with a single channel from both your main thread (where the ioloop is running) and the "Broker" thread (calls submitData in a loop). This is not safe. Also, SimpleReconnectionStrategy does not seem to do anything useful. It does not cause a reconnect if the co...
RabbitMQ
9,508,246
17
I'am creating a microservice in NestJS. Now I want to use RabbitMQ to send messages to another service. My question is: is it possible to import the RabbitmqModule based on a .env variable? Such as: USE_BROKER=false. If this variable is false, than don't import the module? RabbitMQ is imported in the GraphQLModule belo...
I think the recommended way to do so is to use the DynamicModule feature from NestJS. It is explained here: https://docs.nestjs.com/fundamentals/dynamic-modules Simply check your environment variable in the register function and return your Module object. Something like: @Module({}) export class GraphQLModule { stati...
RabbitMQ
65,355,892
16
I need some help. I'm developing a spring boot application, and I want wo publish messages to a rabbitMQ. I want to send it to a queue, that is named in the message itself. This way i want to create queues dynamicly. I only found examples that use a "static" queue. I have reserched some things but didn't find anything....
I came to a solution: You need to create a AmqpAdmin in your config: @Bean public AmqpAdmin amqpAdmin() { return new RabbitAdmin(connectionFactory); } Then you add it to your service: @Autowired private AmqpAdmin admin; Finally you can use it to create queues and bindings. Queue queue = new Queue(queueName, durab...
RabbitMQ
57,870,894
16
I have created a REST API - in a few words, my client hits a particular URL and she gets back a JSON response. Internally, quite a complicated process starts when the URL is hit, and there are various services involved as a microservice architecture is being used. I was observing some performance bottlenecks and decide...
You have few different scenarios according to how much control you have on the client. If the client behaviour cannot be changed, you will have to keep the session open until the request has not been fully processed. This can be achieved employing a pool of workers (futures/coroutines, threads or processes) where each ...
RabbitMQ
53,525,239
16
In the docs it refers to it as the command line tool but that's clt not ctl.
RabbitMQ has a bunch of command line tools, one of which is RabbitMQCtl. The ctl part stands for control. You use it to control RabbitMQ for general administrative/operator tasks.
RabbitMQ
52,807,913
16
I have a RabbitMQ C# Client running in a WCF service. It catches System.NotSupportedException: Pipelining of requests forbidden exception now and then.
Accroding to the gudie.You need to lock the channel for multi-threading. As a rule of thumb, IModel instances should not be used by more than one thread simultaneously: application code should maintain a clear notion of thread ownership for IModel instances.
RabbitMQ
47,152,466
16
I want to test with gitlab-ci.yml a rpc nameko server. I can't succeed to make work the Rabitt inside .gitlab-ci.yml:: image: python:latest before_script: - apt-get update -yq - apt-get install -y python-dev python-pip tree - curl -I http://guest:guest@rabbitmq:8080/api/overview mytest: artifacts: paths: ...
I used it the following way and it worked for me image: "ruby:2.3.3" //not required by rabbitmq services: - rabbitmq:latest variables: RABBITMQ_DEFAULT_USER: guest RABBITMQ_DEFAULT_PASS: guest AMQP_URL: 'amqp://guest:guest@rabbitmq:5672' Now you can use the AMQP_URL env variable to connect to the rabbimq ser...
RabbitMQ
43,409,988
16
recently, I did a quick implementation on producer/ consumer queue system. <?php namespace Queue; use PhpAmqpLib\Connection\AMQPStreamConnection; use PhpAmqpLib\Message\AMQPMessage; use PhpAmqpLib\Wire\AMQPTable; class Amqp { private $connection; private $queueName; private $delayedQueueName; priv...
Fist of all verify that your plugin rabbitmq_delayed_message_exchange enabled by running command: rabbitmq-plugins list, If not - read more info here. And you have to update your __construct method because you need to declare queue in a little bit another way. I do not pretend to update your construct, but would like t...
RabbitMQ
42,990,585
16
I have brew installed rabbitmq on my mac and have tried the following rabbitmq-server start sbin/service rabbitmq-server start and neither work.How do I start it?
You should be able to run /usr/local/sbin/rabbitmq-server or use brew services start rabbitmq
RabbitMQ
39,397,646
16
This seems like a simple question, but I'm having a hard time finding a definitive answer. If in RabbitMQ 3.6.1 I have a queue that looks like this: 5 4 3 2 1 <= head And I consume message 1, then do: channel.BasicReject(ea.DeliveryTag, true); Will the 1 end up on the end of the queue or at the head of the queue...
I'd say the answer is here, I'll quote a part: Messages can be returned to the queue using AMQP methods that feature a requeue parameter (basic.recover, basic.reject and basic.nack), or due to a channel closing while holding unacknowledged messages. Any of these scenarios caused messages to be requeued at the ba...
RabbitMQ
37,709,896
16
I'm new to golang, and I would like to refactorate my code so that the rabbitmq initialization is in another function that main. So I use a struct pointer (containing all the rabbitmq infos initilized) and pass it to the send function, but it tells me : Failed to publish a message: Exception (504) Reason: "channel/conn...
Inside your init, you wrote defer config.conn.Close(), which will be executed when the function return. That is to say, whenever init finished, your connection will be closed, which causes unopen connection. You need to defer the connection closing in main, or somewhere you want it to be closed.
RabbitMQ
36,579,759
16
TL;DR: I need to "replay" dead letter messages back into their original queues once I've fixed the consumer code that was originally causing the messages to be rejected. I have configured the Dead Letter Exchange (DLX) for RabbitMQ and am successfully routing rejected messages to a dead letter queue. But now I want to...
Should I write a one-off program that reads messages from the dead letter queue and allows me to specify a target queue to send them to? generally speaking, yes. you could set up a delayed re-try to resend the message back to the original queue, using a combination of the delay message exchange plugin. but this would...
RabbitMQ
36,186,578
16
I am relatively new to docker, celery and rabbitMQ. In our project we currently have the following setup: 1 physical host with multiple docker containers running: 1x rabbitmq:3-management container # pull image from docker hub and install docker pull rabbitmq:3-management # run docker image docker run -d -e RABBITMQ_NO...
As you suspect, the issue is because the celery worker does not know the tasks module. There are two things you need to do: Get your tasks definitions "into" the docker container. Configure the celery worker to load those task definitions. For Item (1), the easiest way is probably to use a "Docker Volume" to mount a...
RabbitMQ
29,513,813
16
The scenario (I've simplified things): Many end users can start jobs (heavy jobs, like rendering a big PDF for example), from a front end web application (producer). The jobs are sent to a single durable RabbitMQ queue. Many worker applications (consumers) processes those jobs and write the results back in a datastore...
You would need to build something yourself to implement this as Dimos says. Here is an alternative implementation which requires an extra queue and some persistent storage. As well as the existing queue for jobs, create a "processable job queue". Only jobs that satisfy your business rules are added to this queue. Cr...
RabbitMQ
28,414,484
16
I am trying to start the rabbitmq server in centos 7. I installed erlang as it is a dependency to rabbitmq-server. Package erlang.x86_64 0:R16B-03.7.el7 .I then Installed rabbitmq using package rabbitmq-server-3.2.2-1.noarch.rpm. Installation was successful. I enabled management console uisng rabbitmq-plugins enable ra...
Better answer would be to actually fix SELinux and the firewall. Open the port: firewall-cmd --permanent --add-port=5672/tcp firewall-cmd --reload setsebool -P nis_enabled 1 That works for me.
RabbitMQ
25,816,918
16
I'm using rabbitmq to send messages from a single server to multiple clients. I want to send a message to all clients so I have created an exchange which they all bind to. This works great. However, what if I want to send a message to a handful of these clients based on a wildcard in the routing key (not the binding ke...
I think you are trying to do too much with one queue. Considering that you know ahead of time whether the message will go to all clients or just one then you should set up two exchanges. One as a topic, or direct, where the clients will only get the messages specifically intended for them the other as a fanout exchan...
RabbitMQ
22,546,840
16
I have a node.js app that connects to RabbitMQ to receive messages. When the messages come in and I output them to the console I get: { data: <Buffer 62 6c 61 68>, contentType: undefined } How do I get a proper JSON or string out of this? Here is my example: var amqp = require('amqp'); var connection = amqp.createConn...
If you are using amqplib then the below code solves the issue. In the sender.js file i convert data to JSON string var data = [{ name: '********', company: 'JP Morgan', designation: 'Senior Application Engineer' }]; ch.sendToQueue(q, Buffer.from(JSON.stringify(data))); And in the receiver.js i use the below ...
RabbitMQ
22,464,858
16
I want to build a RabbitMQ cluster in my dev machine (windows). reason is that I would like to test and study it. Is it possible to run more than one rabbitmq instance on one machine? I am guessing I need to: Change the listening port Change the appdata folder (C:\Users\MyUser\AppData\Roaming) Change the ui plu...
Now the official RabbitMQ documentation contains a section "A Cluster on a Single Machine", which describes how to run multiple Rabbit nodes on a single machine. See https://www.rabbitmq.com/clustering.html#single-machine
RabbitMQ
21,453,910
16
Can anyone give me examples of how in production a correlation id can be used? I have read it is used in request/response type messages but I don't understand where I would use it? One example (which maybe wrong) I can think off is in a publish subscribe scenario where I could have 5 subscribers and if I get 5 replies ...
A web application that is providing HTTP API for outsiders for performing a processing task and you want to give the results for the caller as a response to the HTTP request they made. A request comes in, message describing the task is pushed to queue by the frontend server. After that the frontend server blocks to wa...
RabbitMQ
20,184,755
16
RabbitMQ's Channel#basicConsume method gives us the following arguments: channel.basicConsume(queueName, autoAck, consumerTag, noLocal, exclusive, arguments, callback); Giving us the ability to tell RabbitMQ exactly which queue we want to consume from. But Channel#basicPublish has no such equivalency: channel.basi...
To expand on @Tien Nguyen's answer, there is a "cheat" in RabbitMQ that effectively lets you publish directly to a queue. Each queue is automatically bound to the AMQP default exchange, with the queue's name as the routing key. The default exchange is also known as the "nameless exchange" - ie its name is the empty str...
RabbitMQ
18,531,308
16
I have a Java client which monitors RabbitMQ queue. I am able to get the count of messages currently in queue with this code @Resource RabbitAdmin rabbitAdmin; .......... DeclareOk declareOk = rabbitAdmin.getRabbitTemplate().execute(new ChannelCallback<DeclareOk>() { public DeclareOk doInRabbit(Channel channel...
With AMQP protocol (including RabbitMQ implementation) you can't get such info with 100% guarantee. The closest number to messages count is messages count returned with queue.declare-ok (AMQP.Queue.DeclareOk in java AMQP client library). Whilst messages count you receive with queue.declare-ok may match exact messages n...
RabbitMQ
17,684,848
16
This RabbitMQ page states: Queue names may be up to 255 bytes of UTF-8 characters. In ruby (1.9.3), how would I truncate a UTF-8 string by byte-count without breaking in the middle of a character? The resulting string should be the longest possible valid UTF-8 string that fits in the byte limit.
For Rails >= 3.0 you have ActiveSupport::Multibyte::Chars limit method. From API docs: - (Object) limit(limit) Limit the byte size of the string to a number of bytes without breaking characters. Usable when the storage for a string is limited for some reason. Example: 'こんにちは'.mb_chars.limit(7).to_s # => "こん"
RabbitMQ
12,536,080
16
I am try to install amqp for php (Integrating PHP with RabbitMQ) using this http://code.google.com/p/php-amqp/. after run phpize && ./configure --with-amqp && make && sudo make install it give error like this Cannot find config.m4. Make sure that you run '/usr/bin/phpize' in the top level source directory of the mo...
You need to download the code for the PHP library from here: http://code.google.com/p/php-amqp/downloads/list Then cd into that folder and run the command they tell you to run. UPDATE: That page is actually an old page, they haven't updated it in a long time. You can grab the latest amqp from http://pecl.php.net/get/am...
RabbitMQ
7,831,407
16
I am a newbie to real-time application development and am trying to wrap my head around the myriad options out there. I have read as many blog posts, notes and essays out there that people have been kind enough to share. Yet, a simple problem seems unanswered in my tiny brain. I thought a number of other people might h...
Architecturally, both of your choices are the same as storing data in an Oracle database server for another application to retrieve. Both the RabbitMQ and the Redis solution require your apps to connect to an intermediary server that handles the data communications. Redis is most like Oracle, because it can be used sim...
RabbitMQ
6,169,658
16
I would like to learn what are the scenarios/usecases/ where messaging like RabbitMQ can help consumer web applications. Are there any specific resources to learn from? What web applications currently are making use of such messaging schemes and how?
In general, a message bus (such as RabbitMQ, but not limited to) allows for a reliable queue of job processing. What this means to you in terms of a web application is the ability to scale your app as demand grows and to keep your UI quick and responsive. Instead of forcing the user to wait while a job is processed th...
RabbitMQ
6,104,418
16
I'd like to selectively delete messages from an AMQP queue without even reading them. The scenario is as follows: Sending side wants to expire messages of type X based on a fact that new information of type X arrived. Because it's very probable that the subscriber didn't consume latest message of type X yet, publisher ...
You do not want a message queue, you want a key-value database. For instance you could use Redis or Tokyo Tyrant to get a simple network-accessible key-value database. Or just use a memcache. Each message type is a key. When you write a new message with the same key, it overwrites the previous value so the reader of th...
RabbitMQ
3,434,763
16
Does the content type header in RabbitMQ have any special meaning, or is it only a standardized way for my producers and consumers to signal what kind of data they are sending? In other words: will messages with certain content types get any special treatment, or is it just bytes, either way?
RabbitMQ doesn't use the content-type header internally at all. It's for producers and consumers to signal message types, as you guessed.
RabbitMQ
3,278,590
16
I cannot seem to start or install my RabbitMQ server anymore for my Ubuntu 18.04 anymore. I tried to remove and install it again, but it cannot finish the install because configuration fails. When I try to run sudo apt-get install --fix-broken. This is the result of it failing: Reading package lists... Done Building de...
I solved the problem with help of my colleague. I had installed newest erlang and rabbitmq from outside apt source separately. Now when I removed and purged everything related to rabbitmq and erlang, and removed the added apt sources too. Then I just ran sudo apt install rabbitmq-server and it wanted to install erlang ...
RabbitMQ
51,961,253
15
Just to make things tricky, I'd like to consume messages from the rabbitMQ queue. Now I know there is a plugin for MQTT on rabbit (https://www.rabbitmq.com/mqtt.html). However I cannot seem to make an example work where Spark consumes a message that has been produced from pika. For example I am using the simple wordco...
It looks like you are using wrong port number. Assuming that: you have a local instance of RabbitMQ running with default settings and you've enabled MQTT plugin (rabbitmq-plugins enable rabbitmq_mqtt) and restarted RabbitMQ server included spark-streaming-mqtt when executing spark-submit / pyspark (either with package...
RabbitMQ
37,863,801
15
I have this issue, I want to know my rabbit is working great. I am not gonna send the message, so, Im not 100% sure is being sent correctly. But the problem is this. After all is configured and all.... I see at the RabbitMQ web manager And when I supposedly send a message the I see activity on the "message rates" cha...
In case RabbitMQ receive non-routable message it drop it. So while message was received, it was not queued. You may configure Alternate Exchanges to catch such messages.
RabbitMQ
37,625,376
15
in this guide https://www.rabbitmq.com/api-guide.html RabbitMQ guys state: Channels and Concurrency Considerations (Thread Safety) Channel instances must not be shared between threads. Applications should prefer using a Channel per thread instead of sharing the same Channel across multiple threads. While some operatio...
I suppose you are using Channel only for your consumer and not for other operations like publish etc.. In your case the only potential problem is here: channel.basicAck(deliveryTag, false); because you call this across two thread, btw this operation is safe, if you see the java code: the class ChannelN.java calls: pu...
RabbitMQ
30,695,375
15
I am running a RabbitMQ Management console on a machine where port above 10000 range are blocked using firewall. Can I change the port so that I can use any one of 9000 range ports ? Please help!
RabbitMQ has a config file rabbitmq.config.example or just rabbitmq.config under /etc/rabbitmq directory on linux servers. Locate the rabbitmq_management tuple and change the port value (default is 12345, change it to whatever you want). Be sure to uncomment or add the following content into /etc/rabbitmq/rabbitmq.conf...
RabbitMQ
30,616,800
15
I am on Ubuntu 14.04 and I installed rabbitmq. As I was reading through the configuration documentation, I wanted to create my own rabbitmq.config file in /etc/rabbitmq/rabbitmq.config, so I searched for an example of a configuration file which I found under /usr/share/doc/rabbitmq-server/rabbitmq.config.example.gz. I ...
It's a standard array format. Delete the comma from the LAST line you uncomment. Right now you're basically making it look like [{blah},]
RabbitMQ
27,692,045
15
Documentation says that rabbitmq has config: /etc/rabbitmq/rabbitmq.conf but I have nothing there, but rabbitmq-server is running and consuming messages. Where is my config file?
It depends in which way you install RabbitMQ. The file usually is not present. If you need it, you have to create it. For example if you use the package: rabbitmq-server-mac-standalone-3.4.2.tar.gz You can find the example file: etc/rabbitmq/rabbitmq.config.example and not the file. Using RABBITMQ_CONFIG_FILE you can...
RabbitMQ
27,379,736
15
I'm currently working on a rabbit-amqp implementation project and use spring-rabbit to programmatically setup all my queues, bindings and exchanges. (spring-rabbit-1.3.4 and spring-framework versions 3.2.0) The declaration in a javaconfiguration class or xml-based configuration are both quite static in my opinion decla...
You can add beans dynamically to the context: context.getBeanFactory().registerSingleton("foo", new Queue("foo")); but they won't be declared by the admin automatically; you will have to call admin.initialize() to force it to re-declare all the AMQP elements in the context. You would not do either of these in @Beans, ...
RabbitMQ
24,241,880
15
If I'm connected to RabbitMQ and listening for events using an EventingBasicConsumer, how can I tell if I've been disconnected from the server? I know there is a Shutdown event, but it doesn't fire if I unplug my network cable to simulate a failure. I've also tried the ModelShutdown event, and CallbackException on th...
I'm guessing that you're using the C# library? (but even so I think the others have a similar event). You can do the following: public class MyRabbitConsumer { private IConnection connection; public void Connect() { connection = CreateAndOpenConnection(); connection.ConnectionShutdown += connection_Conne...
RabbitMQ
15,033,848
15
I would like to check if a Consumer/Worker is present to consume a Message I am about to send. If there isn't any Worker, I would start some workers (both consumers and publishers are on a single machine) and then go about publishing Messages. If there is a function like connection.check_if_has_consumers, I would imple...
I was just looking into this as well. After reading through the source and docs I came across the following in channel.py: @property def consumer_tags(self): """Property method that returns a list of currently active consumers :rtype: list """ return self._consumers.keys() My own testing was success...
RabbitMQ
13,037,121
15
Would have loved to use Amazon SQS if it provided some semblance of FIFO access, but the sequence seems to completely random. Is there something that would provide me FIFO queuing as-a-cloud-service with the high availability of SQS? If that is asking for too much - what would be the easiest way of putting together som...
Update 2016-11-19 Amazon SQS has just gained FIFO Queues with Exactly-Once Processing & Deduplication: Today we are making SQS even more powerful and flexible with support for FIFO (first-in, first-out) queues. We are rolling out this new type of queue in two regions now, and plan to make it available in many ot...
RabbitMQ
10,375,137
15
We're working on an application that supports AMQP for queuing. Some of our clients are using Websphere MQ. I'm just wondering at a high level how interchangeable these two protocols are in terms of functionality. I'm using celery, which should allow me to abstract out the lower-level stuff as long as I can write a ...
UPDATE 23 June 2015 IBM has announced MQ Light which is their implementation of AMQP. their Statement of Direction says that they intend to deliver features to allow programs designed to run on MQ Light to run in MQ at some point in the future but have yet to announce when that will be. MQ Light is in open Beta as of...
RabbitMQ
3,151,966
15
Greetings, I'm evaluating some components for a multi-data center distributed system. We're going to be using message queues (via either RabbitMQ or Qpid) so agents can make asynchronous requests to other agents without worrying about addressing, routing, load balancing or retransmission. In many cases, the agents will...
Coming into this late, but maybe it will be of some use. The primary consideration should be the performance characteristics of your system. ZooKeeper, like you said, is more than capable of implementing a task distribution system using a distributed queue, but zk currently, is more optimized for reads than it is for w...
RabbitMQ
2,669,573
15
Problem: I want to implement several php-worker processes who are listening on a MQ-server queue for asynchronous jobs. The problem now is that simply running this processes as daemons on a server doesn't really give me any level of control over the instances (Load, Status, locked up)...except maybe for dumping ps -aux...
Here's some code that may be useful. <? define('WANT_PROCESSORS', 5); define('PROCESSOR_EXECUTABLE', '/path/to/your/processor'); set_time_limit(0); $cycles = 0; $run = true; $reload = false; declare(ticks = 30); function signal_handler($signal) { switch($signal) { case SIGTERM : global $run; $r...
RabbitMQ
752,214
15
I try to start a Docker container with RabbitMQ, as a result, the image is downloaded, but the container does not start. I get the following message in the logs: error: RABBITMQ_DEFAULT_PASS is set but deprecated error: RABBITMQ_DEFAULT_USER is set but deprecated error: RABBITMQ_DEFAULT_VHOST is set but deprecated erro...
The latest stable docker image for RabbitMQ (3.9) has been recently updated and the official image page says: As of RabbitMQ 3.9, all of the docker-specific variables listed below are deprecated and no longer used. I have resolved the issue in following way: Create a rabbitmq.conf file in the same folder where docker...
RabbitMQ
68,600,215
14
I am running RabbitMQ inside a container on localhost; my /etc/rabbitmq/rabbitmq.conf is pretty straightforward: loopback_users.guest = false listeners.tcp.default = 5672 management.tcp.port = 15672 management.disable_stats = false I can access management ui with no problem (as a default guest user), but I see no grap...
I encountered exactly the same problem today. If you are using rabbitmq inside a container, make sure you are using the correct image, as stated in their website: docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management. The rabbitmq_management plugin is enabled by default. I was using dock...
RabbitMQ
63,708,061
14
What is the difference between ConcurrencyLimit and PrefetchCount in masstransit? and what is the optimize configuration for them.
PrefetchCount is a broker-level setting. It indicates to RabbitMQ (or Azure Service Bus) how many messages should be pushed to the client application so that they're ready for processing. In addition, if a RabbitMQ consumer has prefetch space available, published messages are immediately written to the consumer, reduc...
RabbitMQ
57,258,424
14
I am trying to reproduce the first example of a Java publisher that can be found in RabbitMQ's main page. First, I did it in Java and it worked fine. Then, I tried it on Android and here is where the weird part comes. I have added manually the same jar libraries that I used in my Java program and that are suggested in ...
In java you cannot have code outside of a method. All what you can do is initializing the class members. IMHO it's not a jar import problem. Try this: import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import java.io.IOException; import java.util.concurrent.TimeoutException; import com.rabbitmq...
RabbitMQ
52,487,851
14
I am dealing with communication between microservices. For example (fictive example, just for the illustration): Microservice A - Store Users (getUser, etc.) Microservice B - Store Orders (createOrder, etc.) Now if I want to add new Order from the Client app, I need to know user address. So the request would be like ...
In your case using direct REST calls should be fine. Option 1 Use Rest API : When you need synchronous communication. For example, your case. This option is suitable. Option 2 Use AMQP : When you need asynchronous communication. For example when your order service creates order you may want to notify product service t...
RabbitMQ
50,454,109
14
Tl;dr: "How can I push a message through a bunch of asynchronous, unordered microservices and know when that message has made it through each of them?" I'm struggling to find the right messaging system/protocol for a specific microservices architecture. This isn't a "which is best" question, but a question about what m...
There are two methods of managing a long running process (or a processing involving multiple microservices): Orchestration and choreography. There are a lot of articles describing them. Long story short: In Orchestration you have a microservice that keeps track of the process status and in Choreography all the microse...
RabbitMQ
47,918,407
14
What are advantages of using NServiceBus + RabbitMQ against pure RabbitMQ? I guess it provides additional infrastracture. But what else?
You can definitely just use pure RabbitMQ. You just have to keep a couple things in mind. Warning: This answer will be a bit extremely tongue-in-cheek. First you should read Enterprise Integration Patterns cover to cover and make sure you understand it well. It is 736 pages, and a bit dry, but extremely useful informa...
RabbitMQ
47,060,893
14
I am using RabbitMQ together with Spring's RabbitTemplate. When sending messages to queues using the template send methods, I want the queue to automatically be created/declared if it is not already exists. It is very important since according to our business logic queue names are generated on run-time and I cannot dec...
You can use a RabbitAdmin to automatically declare the exchange, queue, and binding. Check out this thread for more detail. This forum also bit related to your scenario. I have not tried spring with AMQP though, but I believe this would do it. /** * Required for executing adminstration functions against an AMQP Broker...
RabbitMQ
46,872,274
14
Basic nack provides facility to return negative acknowledgement for one or multiple messages. Basic reject has facility to return negative acknowledgement for only one message. Do we have any use case where we definitely need basic reject?
The answer by @cantSleepNow is correct, I would also like to add one more difference which is in their default behaviour. By default, nack will put the message back in the queue for later handling. You can change the setting to not re-queue with nack. With reject, by default, the message is not re-queued by RabbitMQ bu...
RabbitMQ
43,406,639
14
How can I implement a queue with configurable x-message-ttl? I have a queue with x-message-ttl set to 1 minute and I want to change it to 2 minute at runtime. How can this be achieved? I already tried declaring queue again with x-message-ttl = 2 minutes but neither ttl is changing by this nor message is being published...
if you create a queue with arguments x-message-ttl you can't change it, you have to remove and recreate the queue. but you can use the policies: Create queues without ttl arguments create the policy, for example:rabbitmqctl set_policy expiry ".*" "{""expires"":1800000}" --apply-to queues In this way you can change...
RabbitMQ
42,202,437
14
I am trying to start RabbitMQ service on my local Windows laptop but I keep getting this error: I first downloaded erlang (OTP 19.0 Windows 64-bit Binary File) from here: http://www.erlang.org/downloads. Then I downloaded RabbitMQ from here: https://www.rabbitmq.com/install-windows.html Erlang seems to have installed...
I think I had the same problem which lies in the error The filename, directory name, or volume label syntax is incorrect. ... and that maybe when erlang was installed it for some reason is sets the HOMEDRIVE to u: or something silly. From the command line run: SET HOMEDRIVE=C: Then try to run your rabbitmq-service ...
RabbitMQ
38,900,125
14
I'm developing distributed application with help of MassTransit and rabbitmq I have to provide ability to generate report on a web page without page reloading by click on a button, also I should call a windows service for data preparation (The service handles each request for 30sek - 1min). My first try based on ...
I do this using hubs from SignalR, and observe events at the server using regular MassTransit consumers. When events are observed, I trigger the event handler, which dispatches using the Hub to connected clients. That way, the events are pushed down to the browser instantly without leaving an async call pending at the ...
RabbitMQ
37,457,140
14
I am very new to Celery and here is the question I have: Suppose I have a script that is constantly supposed to fetch new data from DB and send it to workers using Celery. tasks.py # Celery Task from celery import Celery app = Celery('tasks', broker='amqp://guest@localhost//') @app.task def process_data(x): # Do ...
You can set rabbitmq x-max-length in queue predeclare using kombu example : import time from celery import Celery from kombu import Queue, Exchange class Config(object): BROKER_URL = "amqp://guest@localhost//" CELERY_QUEUES = ( Queue( 'important', exchange=Exchange('important'...
RabbitMQ
35,231,690
14
Where should you update celery settings? On the remote worker or the sender? For example, I have an API using Django and Celery. The API sends remote jobs to my remote workers via a broker (RabbitMQ). The workers are running a python script (not using Django) sometimes these works spawn sub tasks. I've created celery ...
the django celery settings affects only workers running on the django server itself. if all your workers are remote workers (the way as i do it), then on the sender side all you need is to put the configuration necessary to submit a task to the task queue. and all the other settings need to be set on the remote workers...
RabbitMQ
35,117,752
14
I have three clients each with their own RabbitMQ instances and I have an application (let's call it appA) that has its own RabbitMQ instance, the three client applications (app1, app2, app3) wants to make use of a service on appA. The service on appA requires RPC communication, app1, app2 and app3 each has a booking.r...
Take a look at org.springframework.amqp.rabbit.connection.AbstractRoutingConnectionFactory. It will allow you to create multiple connection factories to different vhosts or different rabbitmq instances. We are using it for a multi tenant rabbitmq application.
RabbitMQ
28,520,784
14
In my local machine I can have: connection = pika.BlockingConnection(pika.ConnectionParameters('localhost')) for both scripts (send.py and recv.py) in order to establish proper communication, but what about to establish communication from 12.23.45.67 to 132.45.23.14 ? I know about all the parameters that ConnectionPar...
first step is to add another account to your rabbitMQ server. To do this in windows... open a command prompt window (windows key->cmd->enter) navigate to the "C:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.2\sbin" directory ( type "cd \Program Files\RabbitMQ Server\rabbitmq_server-3.6.2\sbin" and press enter ) e...
RabbitMQ
27,805,086
14
I have built a WebSockets server that acts as a chat message router (i.e. receiving messages from clients and pushing them to other clients according to a client ID). It is a requirement that the service be able to scale to handle many millions of concurrent open socket connections, and I wish to be able to horizontal...
ZeroMQ would be my option - both architecture-wise & performance-wise -- fast & low latency ( can measure your implementation performance & overheads, down to sub [usec] scale ) -- broker-less ( does not introduce another point-of-failure, while itself can have { N+1 | N+M } self-healing architecture ) -- smart Formal...
RabbitMQ
25,701,094
14
My RabbitMQ server went down and it is impossible to restart it. I tried to restart, reinstall it... I still don't understand the error. This is what I get BOOT FAILED =========== Error description: {could_not_start,rabbit, {bad_return, {{rabbit,start,[normal,[]]}, {'EXIT', {rabbit,failure_du...
For anyone else looking for this error rabbit,failure_during_boot, {badmatch, {error, {{{function_clause, [{rabbit_queue_index,journal_minus_segment1, ... I just dealt with the same issue and what helped was going to the mnesia directories and deleting the queues and msg_store_transient direc...
RabbitMQ
25,619,201
14
So I have a Django app that occasionally sends a task to Celery for asynchronous execution. I've found that as I work on my code in development, the Django development server knows how to automatically detect when code has changed and then restart the server so I can see my changes. However, the RabbitMQ/Celery secti...
I've found that as I work on my code in development, the Django development server knows how to automatically detect when code has changed and then restart the server so I can see my changes. However, the RabbitMQ/Celery section of my app doesn't pick up on these sorts of changes in development. What you've d...
RabbitMQ
22,103,401
14
I have a java web server and am currently using the Guava library to handle my in-memory caching, which I use heavily. I now need to expand to multiple servers (2+) for failover and load balancing. In the process, I switched from a in-process cache to Memcache (external service) instead. However, I'm not terribly impre...
I am a little bit confused about your problem here, so I am going to restate in a way that makes sense to me, then answer my version of your question. Please feel free to comment if I am not in line with what you are thinking. You have a web application that uses a process-local memory cache for data. You want to expan...
RabbitMQ
21,098,502
14
I'm interested in knowing how other people handle recovering from a faulty connection using the official RabbitMQ java client library. We are using it to connect our application servers to our RabbitMQ cluster and we have implemented a few different ways to recover from a connection failure, but non of them feel quite ...
Since version 3.3.0 you can use automatic recovery, which is a new feature of the Java client. From the Java API guide (http://www.rabbitmq.com/api-guide.html#recovery) To enable automatic connection recovery, use factory.setAutomaticRecovery(true):
RabbitMQ
19,695,897
14
I'm writing an application which needs to run a series of tasks in parallel and then a single task with the results of all the tasks run: @celery.task def power(value, expo): return value ** expo @celery.task def amass(values): print str(values) It's a very contrived and oversimplified example, but hopefully ...
Here's a solution which worked for my purposes: tasks.py: from time import sleep import random @celery.task def power(value, expo): sleep(random.randint(10, 1000) / 1000.0) # sleep for 10-1000ms return value ** expo @celery.task def amass(results, tasks): completed_tasks = [] for task in tasks: ...
RabbitMQ
16,308,849
14
When using the HTTP API I am trying to make a call to the aliveness-test for monitoring purposes. At the moment I am testing using curl and the following command: curl -i http://guest:guest@localhost:55672/api/aliveness-test/ And I get the following response: HTTP/1.1 404 Object Not Found Server: MochiWeb/1.1 WebMach...
Turns out that the '/' at the beginning of the vhosts names is not implicit, even when as part of a URL. To get this to work I simply changed my request from: curl -i http://guest:guest@localhost:55672/api/aliveness-test/ To curl -i http://guest:guest@localhost:55672/api/aliveness-test/%2F As %2F is '/' HTTP encoded,...
RabbitMQ
13,237,628
14
At our organization we have a SQL Server 2005 database and a fair number of database clients: web sites (php, zope, asp.net), rich clients (legacy fox pro). Now we need to pass certain events from the core database with other systems (MongoDb, LDAP and others). Messaging paradigm seems pretty capable of solving this ki...
Lest first cut out of the of the equation the obvious misfit: Query Notification is not right technology for this, because is designed to address cache invalidation of relatively stable data. With QN you'll only know that table has changed, but you won't be able to know what had changed. Kudos to you for figuring out w...
RabbitMQ
13,087,058
14
I am using RabbitMQ to have worker processes encode video files. I would like to know when all of the files are complete - that is, when all of the worker processes have finished. The only way I can think to do this is by using a database. When a video finishes encoding: UPDATE videos SET status = 'complete' WHERE file...
Use a "response" queue. I don't know any specifics about RabbitMQ, so this is general: Have your parent process send out requests and keep track of how many it sent Make the parent process also wait on a specific response queue (that the children know about) Whenever a child finishes something (or can't finish for som...
RabbitMQ
7,734,597
14
Pretty straightforward question. I can't find it in the docs or the spec.
From the AMQP spec, section 1.1: If set, the server will not respond to the method. The client should not wait for a reply method. If the server could not complete the method it will raise a channel or connection exception.
RabbitMQ
6,351,698
14
I'm trying to access the RabbitMQ interface over HTTPS/SSL with nginx, and I can't figure out what I'm missing. Here's my rabbitmq.conf file: [ {ssl, [{versions, ['tlsv1.2', 'tlsv1.1']}]}, {rabbit, [ {reverse_dns_lookups, true}, {hipe_compile, true}, {tcp_listeners, [5672]}, {ssl_listeners, ...
I ended up reverting back to the default rabbitmq.config file, then modified my nginx config block to the below, based on another stackoverflow answer that I can't find right now. location ~* /rabbitmq/api/(.*?)/(.*) { proxy_pass http://127.0.0.1:15672/api/$1/%2F/$2?$query_string; proxy_buffering ...
RabbitMQ
49,742,269
13
We have an application that uses Kestrel to serve HTTP requests. We've had some problems in the past where high load caused the thread pool to spawn thousands of threads, at which point we would get lock convoy symptoms. Most of the time, the threads would start blocking each other at Monitor.Enter() somewhere in our c...
Just want to add this for future interwebz travellers. The root cause was that we used a System.Runtime.Caching.MemoryCache instance that we were re-creating frequently without proper disposal. The MemoryCaches created timers for function calls and these timers were not cleared from memory when the cache was replaced, ...
RabbitMQ
43,895,737
13
Rabbit MQ URL looks like : BROKER_URL: "amqp://user:password@remote.server.com:port//vhost" This is not clear where we can find the URL, login and password of RabbitMQ when we need to acccess from remote worker (outside of Localhost). In other way, how to set RabbitMQ IP adress, login and password from Celery / Rabbit...
You can create new user for accessing your RabbitMQ broker. Normally port used is 5672 but you can change it in your configuration file. So suppose your IP is 1.1.1.1 and you created user test with password test and you want to access vhost "dev" (without quotes) then it will look something like this: amqp://test:test@...
RabbitMQ
40,957,599
13
I'm using spring STOMP over Websocket with RabbitMQ. All works fine but simpMessagingTemplate.convertAndSend works very slow, call can take 2-10 seconds (synchronously, block thread). What can be a reason?? RabbitTemplate.convertAndSend take < 1s, but I need stomp over websocket.. UPDATE I try to use ActiveMQ and gets ...
Problem resolved. Its bug in io.projectreactor library version 2.0.4.RELEASE. I change to 2.0.8.RELEASE and its fixed problem. Sending message now take ~50ms. <dependency> <groupId>io.projectreactor</groupId> <artifactId>reactor-net</artifactId> <version>2.0.8.RELEASE</version> </depende...
RabbitMQ
40,380,069
13
As I understand message brokers like RabbitMQ facilitates different applications written in different language/platform to communicate with each other. So since celery can use RabbitMQ as message broker, I believe we can queue task from any application to Celery, even though the producer isn't written in Python. Now I ...
I don't know whether the question is still relevant, but hopefully the answer will help others. Here is how I succeeded in queening a task to Celery example worker. You'll need to establish connection between your producer(client) to RabbitMQ as described here. ConnectionFactory factory = new ConnectionFactory(); ...
RabbitMQ
40,021,066
13
I'm trying to use C# to get RabbitMQ 3.6.2 to use SSL/TLS on Windows 7 against Erlang 18.0. I'm running into errors when I'm enabling SSL in my C# code. I have gone through the steps to set up SSL/TLS here. I've also gone through the [troubleshooting steps][2] which show turn up successful (except I couldn't do the ...
Usual problem is mismatch between what you provide in Ssl.ServerName and host SSL certificate was issued for. Also note that server-side SSL (encrypted connection between your client and server) and client-side authentication with certificate (you provide server with information which confirms that you have certificate...
RabbitMQ
39,642,777
13
I've just installed Erlang 19.0, then Rabbitmq Server 3.6.3. OS - Windows 10. Then I installed rabbitmq_management plugin, then I started rabbitmq-server. I can successfully login into management console. The problem is when I go to Queues I get as error: Got response code 500 with body {"error":"JSON encode error: ...
there are some known issues with Erlang 19, discussed in the RMQ Google Group, here. In other words, 3.6.3 effectively isn't Erlang 19.0-compatible: you'll need to install a prior version of Erlang, until RMQ can be re-built to support the changes in Erlang 19
RabbitMQ
38,275,479
13
I can easily delete queues, like this: rabbitmqadmin delete queue name='MyQ' However, I cannot find a way to delete exchanges. What am I missing?
➜ ./rabbitmqadmin delete exchange name='myexchange' exchange deleted
RabbitMQ
37,867,486
13
I want to send a persistent mesaage via HTTP API. Im using this command: curl -u UN:PWD -H "content-type:application/json" -X POST -d'{"properties":{},"routing_key":"QueueName","payload":"HI","payload_encoding":"string", "deliverymode": 2}' http://url:8080/api/exchanges/%2f/amq.default/publish My queue is durable and ...
delivery_mode is a properties, so you have to put it inside the "properties" as: curl -u guest:guest -H "content-type:application/json" -X POST -d'{"properties":{"delivery_mode":2},"routing_key":"QueueName","payload":"HI","payload_encoding":"string"}' http://localhost:15672/api/exchanges/%2f/amq.default/publish
RabbitMQ
37,067,467
13
I'm trying to create a simple spring boot app with spring boot that "produce" messages to a rabbitmq exchange/queue and another sample spring boot app that "consume" these messages. So I have two apps (or microservices if you wish). 1) "producer" microservice 2) "consumer" microservice The "producer" has 2 domain objec...
Ok, I finally got this working. Spring uses a PayloadArgumentResolver to extract, convert and set the converted message to the method parameter annotated with @RabbitListener. Somehow we need to set the mappingJackson2MessageConverter into this object. So, in the CONSUMER app, we need to implement RabbitListenerConfigu...
RabbitMQ
30,770,725
13
With RabbitMQ I am doing something similar to this: channel.QueueDeclare(QueueName, true, false, false, null); By default RabbitMQ creates a new queue if none of the existing matches the name provided. I would like to have an exception thrown instead. Is that possible? Thanks
You can bind to existing queue without declaring a new one. try { channel.QueueBind(queueName, exchange, routingKey); } catch (RabbitMQ.Client.Exceptions.OperationInterruptedException ex) { // Queue not found } An example of the exception thrown if the queue you're trying to bind does not exist: RabbitMQ.Clie...
RabbitMQ
28,467,316
13
We're currently using RabbitMQ, where a continuously super-fast producer is paired with a consumer limited by a limited resource (e.g. slow-ish MySQL inserts). We don't like declaring a queue with x-max-length, since all messages will be dropped or dead-lettered once the limit is reached, and we don't want to loose mes...
For the x-max-length property, you said you don't want messages to be dropped or dead-lettered. I see there was an update in adding some more capabilities for this. As I see it is specified in the documentation: "Use the overflow setting to configure queue overflow behaviour. If overflow is set to reject-publish, the m...
RabbitMQ
28,041,933
13
I've been working with Celery lately and I don't like it. It's configuration is messy, overcomplicated and poorly documented. I want to send broadcast messages with Celery from a single producer to multiple consumers. What confuses me is discrepancy between Celery terms and terms of underlying transport RabbitMQ. In Ra...
Having looked at the code (it's in the kombu.common package, not celery) and tried it out, it seems to work like this: You define a Broadcast 'queue' named 'foo' in your celery config. This creates an Exchange named 'foo', and an auto_delete queue with a unique id (via uuid), and with the alias 'foo' (I don't think th...
RabbitMQ
24,284,518
13
QueueingConsumer consumer = new QueueingConsumer(channel); System.out.println(consumer.getConsumerTag()); channel.basicConsume("queue1", consumer); channel.basicConsume("queue3", consumer); Is it possible to stop consuming the messages from the queue "queue3" alone dynamically?
Yes you can, using channel.basicCancel(consumerTag); EDIT For example: String tag3 = channel.basicConsume("queue3", consumer); channel.basicCancel(tag3) Here you can find a code that unsubscribe a consumer after 5 seconds: String tag1 = channel.basicConsume(myQueue, autoAck, consumer); String tag2 = channel.basicCon...
RabbitMQ
23,333,863
13