Comments (4)
I discover that the channel didn't close after publishing message in queue.rb every time.
So more message sending, more channels opening, you can execute command 'rabbitmqctl list_channels' to see it.
I fix this issue and test 1000k times, it's just OK. The following is patch. I don't know whether such fixing is suitable, if you have the better idea about this please tell me.
----------------------------------------amqp.patch-------------------------------------------------------
diff -uNr ./amqp/lib/mq/queue.rb ./amqp_fix//lib/mq/queue.rb
--- ./amqp/lib/mq/queue.rb 2010-10-15 14:28:09.340387446 +0800
+++ ./amqp_fix//lib/mq/queue.rb 2010-10-15 14:30:25.413032791 +0800
@@ -361,6 +361,7 @@
end
def publish data, opts = {}
-
exchange.publish(data, opts)
@mq.set_closing true
end
@@ -452,4 +453,4 @@
@eXchange ||= Exchange.new(@MQ, :direct, '', :key => name)
end
end
-end
\ No newline at end of file
+end
diff -uNr ./amqp/lib/mq.rb ./amqp_fix//lib/mq.rb
--- ./amqp/lib/mq.rb 2010-10-15 14:28:09.340387446 +0800
+++ ./amqp_fix//lib/mq.rb 2010-10-15 14:29:49.892032825 +0800
@@ -811,6 +811,10 @@
prefetch(@prefetch_size) if @prefetch_size
end
- def set_closing closing
-
@closing = closing
- end
private
@@ -844,4 +848,4 @@
def MQ.id
Thread.current[:mq_id] ||= "#{hostname
.strip}-#{Process.pid}-#{Thread.current.object_id}"
end
-end
\ No newline at end of file
+end
from amqp.
This patch does not make sense. MQ and queues are meant to be re-used, you should not be creating a new one every time you want to publish a message.
from amqp.
hi tmm1, you're right. The fact is at https://github.com/kennethkalmer/ruote-amqp/issues/#issue/3
from amqp.
Closed as invalid.
from amqp.
Related Issues (20)
- With ruby 1.9, Queue#publish wouldn't work for multi-byte characters. HOT 8
- gemspec not valid in HEAD HOT 1
- Problems with JRuby and eventmachine >= 0.12.6 HOT 4
- stdout error msgs, unrecoverable state of client/consumer, apparent corruption of RabbitMQ database HOT 2
- Empty (zero-length) bodies are never delivered to subscribers HOT 2
- How to ensure that a single message is published? HOT 1
- Subscriptions and services falling over HOT 2
- eventmachine not initialized in thin HOT 5
- Pops receiving Basic.GetEmpty behave unintuitively HOT 5
- No support for accessing server-generated Queue/Exchange names & crash with name: "" and {nowait: false} HOT 2
- Do not declare the queue if it already exist, raise an error if it exists, but has different options HOT 2
- Message count for MQ::Queue isn't reported properly, it's always 0 HOT 1
- User more AMQP-compliant terminology HOT 1
- Expose sync API for MQ#close (Channel.Close) HOT 2
- Raising an exception within AMQP HOT 1
- MQ.queue and MQ::Queue.new doco incorrect for :passive option HOT 1
- Reasonable error handling HOT 1
- Bug in MQ.reset HOT 1
- Nil pointer error in AMQP::Queue.new HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amqp.