amqp 1.0.0.pre2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. data/.travis.yml +3 -0
  2. data/README.md +80 -72
  3. data/amqp.gemspec +5 -13
  4. data/docs/08Migration.textile +4 -0
  5. data/docs/AMQP091ModelExplained.textile +6 -1
  6. data/docs/Bindings.textile +4 -0
  7. data/docs/Clustering.textile +4 -0
  8. data/docs/ConnectingToTheBroker.textile +4 -0
  9. data/docs/ConnectionEncryptionWithTLS.textile +4 -0
  10. data/docs/DocumentationGuidesIndex.textile +4 -0
  11. data/docs/Durability.textile +4 -0
  12. data/docs/ErrorHandling.textile +4 -0
  13. data/docs/Exchanges.textile +4 -0
  14. data/docs/GettingStarted.textile +4 -0
  15. data/docs/PatternsAndUseCases.textile +4 -1
  16. data/docs/Queues.textile +4 -0
  17. data/docs/RabbitMQVersions.textile +4 -0
  18. data/docs/RunningTests.textile +4 -0
  19. data/docs/TestingWithEventedSpec.textile +4 -0
  20. data/docs/Troubleshooting.textile +4 -0
  21. data/docs/VendorSpecificExtensions.textile +4 -0
  22. data/examples/error_handling/automatic_recovery_of_channel_and_queues.rb +1 -1
  23. data/examples/error_handling/automatically_recovering_hello_world_consumer.rb +1 -1
  24. data/examples/error_handling/automatically_recovering_hello_world_consumer_that_uses_a_server_named_queue.rb +1 -1
  25. data/examples/error_handling/connection_level_exception.rb +1 -1
  26. data/examples/error_handling/connection_level_exception_with_objects.rb +1 -1
  27. data/examples/error_handling/connection_loss_handler.rb +4 -3
  28. data/examples/error_handling/hello_world_producer.rb +1 -1
  29. data/examples/error_handling/manual_connection_and_channel_recovery.rb +1 -1
  30. data/examples/extensions/rabbitmq/publisher_confirmations_with_transient_messages.rb +1 -1
  31. data/examples/extensions/rabbitmq/using_alternate_exchanges.rb +1 -1
  32. data/examples/guides/getting_started/01_hello_world.rb +1 -1
  33. data/examples/guides/getting_started/02_hello_world_dslified.rb +1 -1
  34. data/examples/hello_world.rb +1 -1
  35. data/examples/hello_world_with_an_empty_string.rb +1 -1
  36. data/examples/hello_world_with_eventmachine_in_a_separate_thread.rb +2 -2
  37. data/examples/hello_world_with_large_payload.rb +41 -41
  38. data/examples/patterns/request_reply/client.rb +1 -2
  39. data/examples/patterns/request_reply/server.rb +0 -1
  40. data/examples/publishing/returned_messages.rb +1 -1
  41. data/examples/queues/accessing_message_metadata.rb +1 -1
  42. data/examples/queues/cancel_default_consumer.rb +1 -1
  43. data/lib/amqp/channel.rb +34 -16
  44. data/lib/amqp/client.rb +2 -2
  45. data/lib/amqp/connection.rb +2 -1
  46. data/lib/amqp/consumer.rb +2 -2
  47. data/lib/amqp/exceptions.rb +11 -2
  48. data/lib/amqp/exchange.rb +5 -5
  49. data/lib/amqp/queue.rb +51 -26
  50. data/lib/amqp/session.rb +5 -5
  51. data/lib/amqp/version.rb +1 -1
  52. data/spec/integration/basic_get_spec.rb +82 -27
  53. data/spec/integration/basic_return_spec.rb +3 -3
  54. data/spec/integration/channel_level_exception_with_multiple_channels_spec.rb +0 -1
  55. data/spec/integration/exchange_declaration_spec.rb +71 -102
  56. data/spec/integration/extensions/rabbitmq/publisher_confirmations_spec.rb +1 -1
  57. data/spec/integration/fanout_exchange_routing_spec.rb +1 -1
  58. data/spec/integration/multiple_consumers_per_queue_spec.rb +3 -160
  59. data/spec/integration/queue_redeclaration_with_incompatible_attributes_spec.rb +25 -12
  60. data/spec/integration/regressions/concurrent_publishing_on_the_same_channel_spec.rb +1 -1
  61. data/spec/integration/remove_individual_binding_spec.rb +51 -0
  62. data/spec/integration/reply_queue_communication_spec.rb +1 -2
  63. data/spec/integration/store_and_forward_spec.rb +6 -9
  64. data/spec/integration/topic_subscription_spec.rb +5 -4
  65. data/spec/spec_helper.rb +8 -2
  66. data/spec/unit/amqp/connection_spec.rb +3 -1
  67. metadata +93 -109
  68. data/spec/integration/immediate_messages_spec.rb +0 -59
@@ -1,59 +0,0 @@
1
- # encoding: utf-8
2
- require 'spec_helper'
3
-
4
-
5
- describe "When queue has no consumers" do
6
-
7
- #
8
- # Environment
9
- #
10
-
11
- include EventedSpec::AMQPSpec
12
- default_timeout 1.5
13
-
14
- amqp_before do
15
- @producer_channel = AMQP::Channel.new
16
- @consumer_channel = AMQP::Channel.new
17
- end
18
-
19
- # ...
20
-
21
-
22
- #
23
- # Examples
24
- #
25
-
26
- context "and message is published as :immediate" do
27
- it "that message is returned to the publisher" do
28
- exchange = @producer_channel.fanout("amq.fanout")
29
- queue = @consumer_channel.queue("", :exclusive => true)
30
-
31
- exchange.on_return do |basic_return, metadata, payload|
32
- done if payload == "immediate message body"
33
- end
34
-
35
- queue.bind(exchange) do
36
- exchange.publish "immediate message body", :immediate => true
37
- end
38
- end
39
- end
40
-
41
-
42
-
43
- context "and message is published as non :immediate" do
44
- it "that message is dropped" do
45
- exchange = @producer_channel.fanout("amq.fanout")
46
- queue = @consumer_channel.queue("", :exclusive => true)
47
-
48
- exchange.on_return do |basic_return, metadata, payload|
49
- fail "Should not happen"
50
- end
51
-
52
- queue.bind(exchange) do
53
- exchange.publish "non-immediate message body", :immediate => false
54
- end
55
-
56
- done(1.0)
57
- end
58
- end
59
- end # describe