Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cosmetics [ci skip]

  • Loading branch information...
commit a65ead3a1c714c29bb04fb50b14244297bfa3f64 1 parent 5cf5895
Michael Klishin authored
View
2  examples/error_handling/automatic_recovery_of_channel_and_queues.rb
@@ -46,5 +46,5 @@
EM.add_timer(30, show_stopper)
- puts "Connected, authenticated. To really exercise this example, shut AMQP broker down for a few seconds. If you don't it will exit gracefully in 30 seconds."
+ puts "Connected, authenticated. To really exercise this example, shut RabbitMQ down for a few seconds. If you don't it will exit gracefully in 30 seconds."
end
View
2  examples/error_handling/automatically_recovering_hello_world_consumer.rb
@@ -47,5 +47,5 @@
puts "This example needs another script/app to publish messages to amq.fanout. See examples/error_handling/hello_world_producer.rb for example"
- puts "Connected, authenticated. To really exercise this example, shut AMQP broker down for a few seconds. If you don't it will exit gracefully in 45 seconds."
+ puts "Connected, authenticated. To really exercise this example, shut RabbitMQ down for a few seconds. If you don't it will exit gracefully in 45 seconds."
end
View
2  examples/error_handling/automatically_recovering_hello_world_consumer_that_uses_a_server_named_queue.rb
@@ -47,5 +47,5 @@
puts "This example needs another script/app to publish messages to amq.fanout. See examples/error_handling/hello_world_producer.rb for example"
- puts "Connected, authenticated. To really exercise this example, shut AMQP broker down for a few seconds. If you don't it will exit gracefully in 45 seconds."
+ puts "Connected, authenticated. To really exercise this example, shut RabbitMQ down for a few seconds. If you don't it will exit gracefully in 45 seconds."
end
View
2  examples/error_handling/connection_level_exception.rb
@@ -10,7 +10,7 @@
EventMachine.run do
AMQP.connect(:host => '127.0.0.1', :port => 5672) do |connection|
- puts "Connected to AMQP broker. Running #{AMQP::VERSION} version of the gem..."
+ puts "Connected to RabbitMQ. Running #{AMQP::VERSION} version of the gem..."
connection.on_error do |conn, connection_close|
View
2  examples/error_handling/connection_level_exception_with_objects.rb
@@ -37,7 +37,7 @@ def on_error(connection, connection_close)
EventMachine.run do
manager = ConnectionManager.new
manager.connect(:host => '127.0.0.1', :port => 5672) do |connection|
- puts "Connected to AMQP broker. Running #{AMQP::VERSION} version of the gem..."
+ puts "Connected to RabbitMQ. Running #{AMQP::VERSION} version of the gem..."
# send_frame is NOT part of the public API, but it is public for entities like AMQ::Client::Channel
# and we use it here to trigger a connection-level exception. MK.
View
2  examples/error_handling/connection_loss_handler.rb
@@ -28,7 +28,7 @@
connection.close { EventMachine.stop }
end
- puts "Connected, authenticated. To really exercise this example, shut AMQP broker down for a few seconds. If you don't it will exit gracefully in 30 seconds."
+ puts "Connected, authenticated. To really exercise this example, shut RabbitMQ down for a few seconds. If you don't it will exit gracefully in 30 seconds."
Signal.trap "INT", show_stopper
EM.add_timer(30, show_stopper)
View
2  examples/error_handling/manual_connection_and_channel_recovery.rb
@@ -67,5 +67,5 @@ def handle(connection)
EM.add_timer(30, show_stopper)
- puts "Connected, authenticated. To really exercise this example, shut AMQP broker down for a few seconds. If you don't it will exit gracefully in 30 seconds."
+ puts "Connected, authenticated. To really exercise this example, shut RabbitMQ down for a few seconds. If you don't it will exit gracefully in 30 seconds."
end
View
2  examples/extensions/rabbitmq/publisher_confirmations_with_transient_messages.rb
@@ -10,7 +10,7 @@
EventMachine.run do
connection = AMQP.connect(:host => '127.0.0.1')
- puts "Connecting to AMQP broker. Running #{AMQP::VERSION} version of the gem..."
+ puts "Connecting to RabbitMQ. Running #{AMQP::VERSION} version of the gem..."
AMQP::Channel.new(connection) do |channel|
puts "Channel #{channel.id} is now open"
View
2  examples/extensions/rabbitmq/using_alternate_exchanges.rb
@@ -10,7 +10,7 @@
EventMachine.run do
connection = AMQP.connect(:host => '127.0.0.1')
- puts "Connecting to AMQP broker. Running #{AMQP::VERSION} version of the gem..."
+ puts "Connecting to RabbitMQ. Running #{AMQP::VERSION} version of the gem..."
channel = AMQP::Channel.new(connection)
queue = channel.queue("amqpgem.examples.hello_world", :auto_delete => true)
View
2  examples/guides/getting_started/01_hello_world.rb
@@ -6,7 +6,7 @@
EventMachine.run do
connection = AMQP.connect(:host => '127.0.0.1')
- puts "Connected to AMQP broker. Running #{AMQP::VERSION} version of the gem..."
+ puts "Connected to RabbitMQ. Running #{AMQP::VERSION} version of the gem..."
channel = AMQP::Channel.new(connection)
queue = channel.queue("amqpgem.examples.helloworld", :auto_delete => true)
View
2  examples/guides/getting_started/02_hello_world_dslified.rb
@@ -6,7 +6,7 @@
EventMachine.run do
AMQP.connect(:host => '127.0.0.1') do |connection|
- puts "Connected to AMQP broker. Running #{AMQP::VERSION} version of the gem..."
+ puts "Connected to RabbitMQ. Running #{AMQP::VERSION} version of the gem..."
channel = AMQP::Channel.new(connection)
View
2  examples/hello_world.rb
@@ -10,7 +10,7 @@
EventMachine.run do
connection = AMQP.connect(:host => '127.0.0.1')
- puts "Connected to AMQP broker. Running #{AMQP::VERSION} version of the gem..."
+ puts "Connected to RabbitMQ. Running #{AMQP::VERSION} version of the gem..."
channel = AMQP::Channel.new(connection)
queue = channel.queue("amqpgem.examples.hello_world", :auto_delete => true)
View
2  examples/hello_world_with_an_empty_string.rb
@@ -10,7 +10,7 @@
EventMachine.run do
connection = AMQP.connect(:host => '127.0.0.1')
- puts "Connected to AMQP broker. Running #{AMQP::VERSION} version of the gem..."
+ puts "Connected to RabbitMQ. Running #{AMQP::VERSION} version of the gem..."
connection.on_error do |conn, connection_close|
View
4 examples/hello_world_with_eventmachine_in_a_separate_thread.rb
@@ -17,7 +17,7 @@
EventMachine.next_tick {
connection = AMQP.connect(:host => '127.0.0.1')
- puts "Connected to AMQP broker. Running #{AMQP::VERSION} version of the gem..."
+ puts "Connected to RabbitMQ. Running #{AMQP::VERSION} version of the gem..."
channel = AMQP::Channel.new(connection)
queue = channel.queue("amqpgem.examples.hello_world", :auto_delete => true)
@@ -34,4 +34,4 @@
exchange.publish "Hello, world!", :routing_key => queue.name
}
-t.join
+t.join
View
82 examples/hello_world_with_large_payload.rb
@@ -17,7 +17,7 @@
EventMachine.next_tick {
connection = AMQP.connect(:host => '127.0.0.1')
- puts "Connected to AMQP broker. Running #{AMQP::VERSION} version of the gem..."
+ puts "Connected to RabbitMQ. Running #{AMQP::VERSION} version of the gem..."
channel = AMQP::Channel.new(connection)
queue = channel.queue("amqpgem.examples.hello_world", :auto_delete => true)
@@ -62,31 +62,31 @@
A TCP segment consists of a segment header and a data section. The TCP header contains 10 mandatory fields, and an optional extension field (Options, pink background in table).
The data section follows the header. Its contents are the payload data carried for the application. The length of the data section is not specified in the TCP segment header. It can be calculated by subtracting the combined length of the TCP header and the encapsulating IP segment header from the total IP segment length (specified in the IP segment header).
- TCP Header Bit offset 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
- 0 Source port Destination port
- 32 Sequence number
- 64 Acknowledgment number (if ACK set)
- 96 Data offset Reserved C
+ TCP Header Bit offset 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
+ 0 Source port Destination port
+ 32 Sequence number
+ 64 Acknowledgment number (if ACK set)
+ 96 Data offset Reserved C
W
- R E
+ R E
C
- E U
+ E U
R
- G A
+ G A
C
- K P
+ K P
S
- H R
+ H R
S
- T S
+ T S
Y
- N F
+ N F
I
- N Window Size
- 128 Checksum Urgent pointer (if URG set)
+ N Window Size
+ 128 Checksum Urgent pointer (if URG set)
160
- ... Options (if Data Offset > 5)
- ... padding
+ ... Options (if Data Offset > 5)
+ ... padding
Source port (16 bits) – identifies the sending port
Destination port (16 bits) – identifies the receiving port
@@ -337,17 +337,17 @@
The checksum field is the 16 bit one's complement of the one's complement sum of all 16-bit words in the header and text. If a segment contains an odd number of header and text octets to be checksummed, the last octet is padded on the right with zeros to form a 16-bit word for checksum purposes. The pad is not transmitted as part of the segment. While computing the checksum, the checksum field itself is replaced with zeros.
In other words, after appropriate padding, all 16-bit words are added using one's complement arithmetic. The sum is then bitwise complemented and inserted as the checksum field. A pseudo-header that mimics the IPv4 packet header used in the checksum computation is shown in the table below.
- TCP pseudo-header (IPv4) Bit offset 0–3 4–7 8–15 16–31
- 0 Source address
- 32 Destination address
- 64 Zeros Protocol TCP length
- 96 Source port Destination port
- 128 Sequence number
- 160 Acknowledgement number
- 192 Data offset Reserved Flags Window
- 224 Checksum Urgent pointer
- 256 Options (optional)
- 256/288+
+ TCP pseudo-header (IPv4) Bit offset 0–3 4–7 8–15 16–31
+ 0 Source address
+ 32 Destination address
+ 64 Zeros Protocol TCP length
+ 96 Source port Destination port
+ 128 Sequence number
+ 160 Acknowledgement number
+ 192 Data offset Reserved Flags Window
+ 224 Checksum Urgent pointer
+ 256 Options (optional)
+ 256/288+
Data
@@ -359,24 +359,24 @@
Any transport or other upper-layer protocol that includes the addresses from the IP header in its checksum computation must be modified for use over IPv6, to include the 128-bit IPv6 addresses instead of 32-bit IPv4 addresses.
A pseudo-header that mimics the IPv6 header for computation of the checksum is shown below.
- TCP pseudo-header (IPv6) Bit offset 0 - 7 8–15 16–23 24–31
- 0 Source address
+ TCP pseudo-header (IPv6) Bit offset 0 - 7 8–15 16–23 24–31
+ 0 Source address
32
64
96
- 128 Destination address
+ 128 Destination address
160
192
224
- 256 TCP length
- 288 Zeros Next header
- 320 Source port Destination port
- 352 Sequence number
- 384 Acknowledgement number
- 416 Data offset Reserved Flags Window
- 448 Checksum Urgent pointer
- 480 Options (optional)
- 480/512+
+ 256 TCP length
+ 288 Zeros Next header
+ 320 Source port Destination port
+ 352 Sequence number
+ 384 Acknowledgement number
+ 416 Data offset Reserved Flags Window
+ 448 Checksum Urgent pointer
+ 480 Options (optional)
+ 480/512+
Data
@@ -396,4 +396,4 @@
exchange.publish(payload, :routing_key => queue.name)
}
-t.join
+t.join
View
2  examples/queues/accessing_message_metadata.rb
@@ -10,7 +10,7 @@
EventMachine.run do
connection = AMQP.connect(:host => '127.0.0.1')
- puts "Connected to AMQP broker. Running #{AMQP::VERSION} version of the gem..."
+ puts "Connected to RabbitMQ. Running #{AMQP::VERSION} version of the gem..."
channel = AMQP::Channel.new(connection)
queue = channel.queue("amqpgem.examples.hello_world", :auto_delete => true)
View
2  examples/queues/cancel_default_consumer.rb
@@ -10,7 +10,7 @@
EventMachine.run do
connection = AMQP.connect(:host => '127.0.0.1')
- puts "Connected to AMQP broker. Running #{AMQP::VERSION} version of the gem..."
+ puts "Connected to RabbitMQ. Running #{AMQP::VERSION} version of the gem..."
channel = AMQP::Channel.new(connection)
queue = channel.queue("amqpgem.examples.hello_world", :auto_delete => true)

3 comments on commit a65ead3

@PositiveAlex

Hello, thank you for your wonderful examples section. But I have a question. Can I somehow add a :timelimit to a consumer ?
f.i.

queue.subscribe(:timelimit => 1) do 
   # some stuff
end

To be able to prevent waiting for messages, meaning that we got an error in some integrated system whom process has been failed by some reason and the answer has not been received back to the rabbit ?

@michaelklishin

There is no time-capped waiting. You can use regular EventMachine timeouts.

Also, would you mind asking questions on the mailing list and not in the comments for unrelated commits? Thanks.

@PositiveAlex
Please sign in to comment.
Something went wrong with that request. Please try again.