Commit Graph

358 Commits

Author SHA1 Message Date
Simon MacMullen 94ade5d9dd stable to default 2013-01-24 13:15:52 +00:00
Emile Joubert 4e730491c7 Update copyright 2013 2013-01-23 11:40:49 +00:00
Matthias Radestock 18877f91c8 merge stable into default 2013-01-08 11:51:06 +00:00
Matthias Radestock 23f036d082 correctly enable test 2013-01-08 11:50:37 +00:00
Matthias Radestock 7fcb2ea1be actually enable the test 2013-01-08 11:39:30 +00:00
Matthias Radestock ff017197ca fail properly 2013-01-08 11:36:57 +00:00
Matthias Radestock e235a8d42a fix bug in test
it's a throw, not an exit
2013-01-07 18:08:40 +00:00
Emile Joubert eeaf125c38 Less severe failure when waiting on unselected channels 2013-01-07 17:03:35 +00:00
Emile Joubert 0095e042a3 Use less state 2012-12-20 16:16:32 +00:00
Emile Joubert 3d23af7af5 Prevent waiting for confirms unless selected 2012-12-20 15:00:24 +00:00
Simon MacMullen 455e8c0f9a It seems more obvious to treat the no password variant as the special case. 2012-09-20 17:00:55 +01:00
Emile Joubert 87994f521f Update tests 2012-09-18 11:18:01 +01:00
Simon MacMullen 33c01884cb Merge bug25057 2012-08-15 13:52:24 +01:00
Francesco Mazzoli 1c05823f35 add functions to unregister handlers
I have added tests for the return handler only since it is the easiest
to check. the confirm handler would be easy as well if it wasn't for
`setup_publish', which does not let you republish messages to the
exchange - I can add them if you think we need them. I would have to
set up some more code for the flow one as well.
2012-07-16 16:23:44 +01:00
Matthias Radestock 7749390ecf move internal definitions etc out of amqp_client.hrl
...in order to avoid application name space polution
2012-07-02 16:54:31 +01:00
Simon MacMullen fb57809497 And again, globally raise the timeouts. 2012-05-16 12:23:14 +01:00
Emile Joubert 69665f3ff6 Merged bug24624 into default 2012-02-06 16:12:43 +00:00
Simon MacMullen 692884fc78 Merge bug24500 2012-02-03 15:36:20 +00:00
Simon MacMullen 74ffe957cd Merge bug24606 2012-02-03 13:05:25 +00:00
Simon MacMullen c8f222c60e Merge bug24692. 2012-02-03 11:48:13 +00:00
Simon MacMullen 924ccc903d Move rabbit_misc:nodeparts/1 and rabbit_misc:makenode/1 into rabbit_nodes 2012-02-02 14:36:16 +00:00
Emile Joubert 44278dc2b8 Update copyright 2012 2012-02-02 13:04:28 +00:00
Simon MacMullen e0a21b2fa3 Unbreak the network client. Oops. Tests pass now :) 2012-01-25 16:00:19 +00:00
Alexandru Scvortov 85e8ec4951 deconvolute logic
The first problem pointed out in the previous commit no longer applies.

The only change in semantics is that wait_for_confirms_or_die will wait for
all acks and nacks before exit(nacks_received).  It shouldn't matter much.
2012-01-24 17:50:16 +00:00
Alexandru Scvortov 976b651560 add timeout to wait_for_confirms[_or_die]
This also fixes two bugs:
  1) Handling nacks never worked.  It would do a gen_server:call inside a
  gen_server:call and would just lockup.  We circumvent the problem now, by
  calling handle_close/4 instead of close/3;
  2) In channels_manager, after the first erronous frame, the state would be
  replaced by 'ok'.  That's fixed now.
2012-01-24 17:03:05 +00:00
Emile Joubert 88d184be09 Relax default timeout 2012-01-20 13:12:20 +00:00
Matthias Radestock 93c86f1958 make tests work on R15 2012-01-16 07:44:59 +00:00
Simon MacMullen 2763345bd0 Make wait_for_confirms not hang under the influnce of multiple=true. 2011-10-18 17:48:03 +01:00
Alexandru Scvortov 3e2419ab22 make tests a bit more comprehensive 2011-10-17 11:53:54 +01:00
Alexandru Scvortov 9d7c6fbbd3 add more checks to the tests
There was also a bug: "amqp://host" would parse to vhost "", instead of vhost
"/".
2011-10-17 11:40:23 +01:00
Alexandru Scvortov ee25d6a734 support mixed case schemes + more docs 2011-10-17 11:14:58 +01:00
Alexandru Scvortov 909e86d358 support R12B-5 and better docs 2011-10-10 15:04:00 +01:00
Alexandru Scvortov baf6480c62 rename url -> uri; do params_network conversion in amqp_uri 2011-09-27 17:35:40 +01:00
Alexandru Scvortov cc1c548251 refactor + handle entities + url tests 2011-09-26 16:52:57 +01:00
Matthias Radestock 1d78937835 use confirms to ensure messages ended up in queues...
so we don't rely on 'purge' not overaking 'publish'.
2011-08-18 18:27:43 +01:00
Matthias Radestock da87a41245 use 'purge' instead of passive 'declare' to determine msg count...
since as of bug 24194 a 'declare' may overtake a 'publish'
2011-08-18 18:13:10 +01:00
Matthew Sackman 61ec3a9e53 Rework return from new_connection so that we detect sooner if there's been a problem creating the connection 2011-08-09 12:42:04 +01:00
Alexandru Scvortov 1de9c86bb0 merge default into bug24018 2011-08-09 12:11:18 +01:00
Matthew Sackman fc7355471e Merging bug23838 to default 2011-08-08 14:23:57 +01:00
Alexandru Scvortov 58f30b55b7 ipv6 + ssl test 2011-07-29 18:26:52 +01:00
Alexandru Scvortov f4b5f3a2b6 add ipv6 test 2011-07-29 18:03:45 +01:00
Alexandru Scvortov 26c55bb4c2 update copyright year 2011-07-28 14:30:09 +01:00
Alexandru Scvortov af5f1c85e4 direct tests run again
(and covertly strip trailing whitespace)
2011-07-28 14:01:36 +01:00
Alexandru Scvortov 6ca8225d0d merge from default
Direct tests still fail.  There might also be a test or two missing.
2011-07-28 13:46:07 +01:00
Alexandru Scvortov 680957725b merge default into bug23117 2011-07-18 14:52:56 +01:00
Simon MacMullen e583b7978e Merge bug24229 to default 2011-07-14 16:36:36 +01:00
Alexandru Scvortov 23926b369a add wait_for_confirms_or_die/1 2011-07-11 09:57:04 +01:00
Alexandru Scvortov 19af12bb6a remove useless check
I'm not sure we actually have a way to check that the two events,
returning from wait_for_confirms and the all published messages being
acknowledged, happen in the right order.  It's especially problematic
since we don't have shared mutable variables like in Java.
2011-07-11 09:04:37 +01:00
Alexandru Scvortov b53d0a9eb1 add tests 2011-07-08 17:58:15 +01:00
Alexandru Scvortov d6fe655d23 don't inspect gs's From tuple; re-add channel:subscribe
I don't like the idea of having subscribe in the consumer modules.
Subscription is something all the consumers need to handle, so it
seems odd to have to do:
  amqp_selective_consumer:subscribe(...
or even
  (amqp_channel:get_consumer_module()):subscribe(...

It seems far more natural to do:
  amqp_channel:subscribe(...

The only thing the old subscribe function could do that the current
call('basic.consume'{}... ) can't is subscribe make a different pid as
the subscriber, so I re-added
  amqp_channel:subscribe(Channel, BasicConsume, Subscriber)

Now, this is exactly the same as running
amqp_channel:call('basic.consume'{}...) from the Subscriber process.

Instead of splitting the From tuple, we're now just adding the Sender
to all amqp_channel calls.  The only time when this is currently used
is sending a basic.consume the the consumer module.

This also allows us to treat subscribes and consumes the same way, as
opposed to the old code that had a lot of special handling for
consumes in selective_subscriber.
2011-07-06 11:20:24 +01:00
Alexandru Scvortov 62e52f44ea all consumer module functions may returns errors 2011-07-05 17:18:56 +01:00
Alexandru Scvortov f2d58c1951 remove call to test that hasn't existed since 2.1.0 2011-07-04 12:28:22 +01:00
Alexandru Scvortov 0b8d25b4e6 auto-select ports for normal and ssl connections
Also, unbreak SSL tests.
2011-07-04 12:19:04 +01:00
Alexandru Scvortov 5752c1f3ff fix a couple of warning and remove a dangling comment 2011-06-30 13:17:14 +01:00
Alexandru Scvortov 1f19dcad5d re-enable selective's default consumer and add a test for it
We're also doing something with the monitors now: selective keeps
track of which consumers are still alive; when it receives a message,
it either routes it to the appropriate consumer if it was registered
and is still alive, or to the default consumer if it exists, or drops
it otherwise.  Monitors are used to remove dead consumers.

There's a race between the consumer dying and messages for it: it's
possible for the consumer to die, and a few messages to get lost
before selective receives the DOWN and starts re-routing messages to
the default consumer.
2011-06-30 11:45:47 +01:00
Alexandru Scvortov 28eb4c4190 tests pass 2011-06-29 16:32:32 +01:00
Alexandru Scvortov 4e56303921 remove selective_consumer:cancel/2 and comments mentioning it or subscribe/2 2011-06-29 13:28:27 +01:00
Vlad Alexandru Ionescu af065e3315 merging in from default 2011-06-03 17:01:38 -05:00
Simon MacMullen 5650f0fed0 Separate out different types for network and direct connections, don't check the password for direct ones. 2011-05-03 15:35:25 +01:00
Vlad Alexandru Ionescu caedd9f7b9 merging in from default 2011-04-07 10:28:12 -05:00
Vlad Alexandru Ionescu 8639d5c88c fixing tests in source tarball 2011-04-02 09:02:43 +01:00
Vlad Alexandru Ionescu f9af40d3d1 abstracting out unit tests 2011-04-01 22:14:31 +01:00
Vlad Alexandru Ionescu a6f8ce8295 merging in from bug23117 2011-04-01 19:20:00 +01:00
Vlad Alexandru Ionescu b98bc37dad adding documentation for exit reasons in amqp_channel and amqp_connection 2011-04-01 18:45:39 +01:00
Vlad Alexandru Ionescu ea9ef4e131 fixing discrepancies between exit reason in the two types of connections 2011-04-01 17:56:39 +01:00
Vlad Alexandru Ionescu c740cf6057 fixing simultaneous channel close bug; adding test for it 2011-04-01 16:57:35 +01:00
Vlad Alexandru Ionescu 964543d122 updating documentation for the consumer mechanism 2011-03-30 21:23:13 +01:00
Vlad Alexandru Ionescu 077275abf5 adding amqp_direct_consumer and amqp_selective_consumer implementations; fixing tests 2011-03-30 18:55:19 +01:00
Vlad Alexandru Ionescu 1f15d7edd1 changing the more usual exit reasons to {shutdown, Reason} for connections and channels 2011-03-29 16:02:00 +01:00
Vlad Alexandru Ionescu 084239a7bf merging in from default 2011-03-17 19:25:11 +00:00
Matthew Sackman 59396dbef5 Added tests for consumer death notification 2011-03-04 17:11:41 +00:00
Vlad Alexandru Ionescu 508f2d523b merging in from default 2011-01-28 18:02:19 +00:00
Vlad Alexandru Ionescu 8a0f9ef895 fixing connection_closing exit reason in channels 2011-01-28 17:37:44 +00:00
Matthew Sackman 86fa202656 Merging bug23696 to default 2011-01-28 17:08:18 +00:00
Matthew Sackman 0925cac294 Merging bug23410 to default 2011-01-28 13:16:29 +00:00
Vlad Alexandru Ionescu f65fcc0b7d fixing subscribe nowait bug; adding test for it 2011-01-27 20:34:00 +00:00
Vlad Alexandru Ionescu 1b053392c9 minor 2011-01-27 19:42:27 +00:00
Vlad Alexandru Ionescu 91554a71e8 fixing amqqueue call bug; swapping test_direct and test_remote_direct in make test_suites and make all_tests; adding direct tests to common package test; updating rabbit_common.app 2011-01-27 17:19:16 +00:00
Vlad Alexandru Ionescu 2359429a5a merging in from default 2011-01-27 13:48:49 +00:00
Alexandru Scvortov 47dbeb0e6d rename ack_handler to confirm_handler and handle basic.nacks 2011-01-26 13:02:41 +00:00
Vlad Alexandru Ionescu e34348ff43 minor 2011-01-20 19:06:39 +00:00
Vlad Alexandru Ionescu 79cca459ac adding test suite for direct connection to different rabbit node; general test makefile cleanup 2011-01-20 18:51:19 +00:00
Vlad Alexandru Ionescu 41f73f2a80 updating license year 2011-01-20 15:40:16 +00:00
Vlad Alexandru Ionescu 03106aff67 fixing some merge conflicts; other cosmetic 2011-01-19 21:42:24 +00:00
Vlad Alexandru Ionescu 28a197e8a2 fixing failing tests 2011-01-18 17:33:11 +00:00
Vlad Alexandru Ionescu 3d1683e85e merging in from default 2011-01-17 17:08:54 +00:00
Vlad Alexandru Ionescu 6b711d0a3c merging bug23562 into default 2011-01-17 15:49:04 +00:00
Rob Harrop 1185a327c1 Simplified nack tests in erlang client 2011-01-14 11:52:22 +00:00
Rob Harrop 852c066d25 Merge with default 2011-01-12 15:27:15 +00:00
Rob Harrop 02794d22dc tests for basic.nack 2011-01-12 15:27:07 +00:00
Rob Harrop 604178e3ea Beginnings of a test for basic.nack 2011-01-12 10:16:15 +00:00
Matthew Sackman e8002b9be0 Merging default into bug23055 2011-01-11 13:03:24 +00:00
Rob Harrop 80e6abcd41 Merge with default 2011-01-10 12:28:40 +00:00
Vlad Alexandru Ionescu a7fe9b6c72 merging in from default 2010-12-16 18:34:34 +00:00
Vlad Alexandru Ionescu 308d3a5555 fixing ignored tests 2010-12-16 18:17:56 +00:00
Vlad Alexandru Ionescu 88a8d6851a merging in from default 2010-12-16 17:42:13 +00:00
Vlad Alexandru Ionescu b85eba361b merging in from default 2010-12-16 15:41:06 +00:00
Vlad Alexandru Ionescu c1e4ac0a56 fixing some merge conflicts 2010-12-01 18:21:19 +00:00
Rob Harrop e30ade2aaa Some cosmetic fixes and a test for the pub ack functionality 2010-11-30 16:43:40 +00:00
Rob Harrop 554fa21b4b Removed tests for requeue=false since we don't support this now 2010-11-30 15:36:31 +00:00
Vlad Alexandru Ionescu 63de61d6c2 general refactoring in amqp_channel; checking if tag is already in use, on subscribe 2010-11-23 18:56:49 +00:00
Vlad Alexandru Ionescu ff4e91379b extending timeout for method serialization tests 2010-11-23 15:59:29 +00:00
Vlad Alexandru Ionescu c23b52ac51 merging in from default 2010-11-16 15:11:03 +00:00
Vlad Alexandru Ionescu de890420dc merging in from default 2010-11-16 13:32:19 +00:00
Vlad Alexandru Ionescu 4b6831ab72 more consistent error reporting on failed handshake; heartbeating is now started between connection.tune and .tune_ok; the network connection follows the closing protocol if it fails to receive connection.open_ok 2010-11-04 22:18:37 +00:00
Vlad Alexandru Ionescu 9bdcfde17f updating license boilerplate 2010-11-04 17:35:36 +00:00
Vlad Alexandru Ionescu e99e48c851 fixing failing qos test 2010-11-04 17:17:50 +00:00
Vlad Alexandru Ionescu 85abc07663 adding more tests for ensuring proper method ordering 2010-11-04 16:59:27 +00:00
Vlad Alexandru Ionescu 9ddc8873d9 fixing methods overtacking each other 2010-10-28 18:35:58 +01:00
Vlad Alexandru Ionescu eed0fd2ab2 updating license boilerplate in all files 2010-10-28 16:37:10 +01:00
Vlad Alexandru Ionescu bb0d0a2b2e changing connection_closing to a cast; updating amqp_dbg 2010-10-13 16:33:25 +01:00
Vlad Alexandru Ionescu 0b4a9fce18 fixing merge conflicts 2010-10-12 19:57:17 +01:00
Vlad Alexandru Ionescu ec814c68b3 merging in from default 2010-10-12 18:39:16 +01:00
Vlad Alexandru Ionescu 46a6500ee8 better error reporting on connection startup; fixing compile warnings 2010-10-11 20:45:19 +01:00
Vlad Alexandru Ionescu c35cd644e5 adding amqp_gen_connection module; all duplication between connection types has now been removed 2010-10-11 18:20:58 +01:00
Vlad Alexandru Ionescu be33721ad1 merging in from default 2010-10-05 12:23:07 +01:00
Vlad Alexandru Ionescu 64b37f7c50 merging in from default 2010-10-04 12:51:05 +01:00
Matthew Sackman 1540e75b28 Merging bug 23024 onto default. Drive-by correction to amqp_client.app.in 2010-10-01 16:50:53 +01:00
Vlad Alexandru Ionescu 5df54a19a2 merging in from bug23024 2010-09-24 16:55:31 +01:00
Vlad Alexandru Ionescu 13db1190fb removing use of timer:sleep in tests; cosmetics 2010-09-24 12:33:59 +01:00
Matthew Sackman c8f83afbc2 Endless cosmetics 2010-09-20 15:44:12 +01:00
Vlad Alexandru Ionescu a1ee995808 connection now sends connection.close if it receives a channel method on channel0 or a connection method on a channel; better support for sending the server errors, using #amqp_error and rabbit_binary_generator:map_exception/3; tests for command_invalid errors due to server misbehaviour; other small fixes 2010-09-17 12:28:24 +01:00
Vlad Alexandru Ionescu d2676f736f removing channel flow test 2010-09-15 17:30:55 +01:00
Vlad Alexandru Ionescu 611ae43f21 fixing merge conflicts 2010-09-14 13:12:06 +01:00
Vlad Alexandru Ionescu 78c6bc3e90 merging in from default 2010-09-14 12:57:32 +01:00
Matthew Sackman e1677c480d Merge default into bug 23234 (now broker default works with erlang client on 23234 with new API) 2010-09-10 15:10:37 +01:00
Matthew Sackman cfadb215a2 Merging bug 22993 into default 2010-09-10 14:46:52 +01:00
Matthew Sackman 92f9e7f233 Revert connection API to throw on error, as it does on default 2010-09-09 14:31:25 +01:00
Vlad Alexandru Ionescu 50091a9c95 removing connection:start_link; making open_channel return {ok, Pid} | {error, Error} 2010-09-08 14:41:27 +01:00
Matthew Sackman 60dd766b0e Be more robust in waiting for process termination 2010-09-07 16:56:44 +01:00
Matthew Sackman 19c5eae78c Support linked and unlinked versions in the supervisor branch too. Unfortunately, there's no supervisor:start, only supervisor:start_child. Luckily, all the children are dynamically started, thus we can unlink it after it's created and before it has any children added. However, I still can't get the negative_test_util:channel_writer_death_test test to pass 2010-09-06 17:35:25 +01:00
Matthew Sackman 955520a7ec Turns out to be very important to support both start_link and start variants 2010-09-06 17:17:44 +01:00
Matthew Sackman 1a3eafcf08 Support older API still on default 2010-09-06 12:09:00 +01:00
Matthew Sackman ef2faba6b1 Make amqp_connection API more OTPish and better abstracted (changes lifted from bug 22993) 2010-09-06 11:47:01 +01:00
Vlad Alexandru Ionescu 481bba47fd forgot to update amqp_dbg 2010-09-03 13:27:26 +01:00
Vlad Alexandru Ionescu cac9609396 fixing merge conflicts; more consistent children types in supervision hierarchy; removing amqp_channel_util module entirely; better error handling code; other smaller fixes 2010-09-03 13:20:19 +01:00
Vlad Alexandru Ionescu e9b1b31bb4 merging in from bug22993 2010-09-02 12:44:48 +01:00
Vlad Alexandru Ionescu ab2980beee removing supervisor info item in connections; updating amqp_dbg 2010-09-01 18:27:43 +01:00
Vlad Alexandru Ionescu e97750e98b debitroting; moving all children start code in the supervisors; other small fixes 2010-09-01 16:30:42 +01:00
Vlad Alexandru Ionescu 2b9a3b8d33 fixing failing tests 2010-08-05 16:33:15 +01:00
Vlad Alexandru Ionescu 6d1ae7a0d2 minor amqp_dbg fix 2010-08-05 13:00:35 +01:00
Vlad Alexandru Ionescu 8b8056bb92 merging in from bug22993 2010-08-04 15:09:21 +01:00
Vlad Alexandru Ionescu fae295c7e9 fixing leftovers; need to find a way to get connection exit reason if it fails to start and return it as {error, Reason} from amqp_connection_sup:start_link/2 2010-08-02 18:15:59 +01:00
Vlad Alexandru Ionescu caedde16fc supervision children are now properly started in supervisor's init; adding amqp_connection_specific_sup 2010-08-02 15:24:23 +01:00
Vlad Ionescu c0f0decf2e adding amqp_channels_manager; adding two tests for opening and closing channels repeatedly and in paralel; removing some duplication between network and direct connections; other refactorings; other small fixes 2010-07-30 15:24:17 +01:00
Vlad Ionescu eca87dda95 cosmetic 2010-07-26 20:05:32 +01:00
Vlad Ionescu ed20971d86 fixing some merge conflicts; moving heartbeat from main reader to the network connection module - the two heartbeating processes are added to amqp_connection_sup; other small fixes 2010-07-26 18:23:39 +01:00
Vlad Ionescu e51fb6db69 major refactoring to supervise all processes; amqp_connection_{network,direct} processes now lives under amqp_connection_sup which uses amqp_infra_sup; amqp_channel now lives under amqp_channel_sup which uses amqp_infra_sup; amqp_channel_sup lives under amqp_channel_sup_sup which lives under amqp_connection_sup; adapting all processes to work with the supervision model; changing the way to start connections in the API; other smaller fixes 2010-07-26 17:31:21 +01:00
Vlad Ionescu 5d367771e3 amqp_main_reader is now a gen_server 2010-07-21 17:26:47 +01:00
Vlad Ionescu 5c33dc5218 cleaning up all makefiles in the client; make -j works; client does not do unnecessary builds anymore; source tarball makefile does not contain unnecessary make targets (some of which would not work); other smaller makefile fixes 2010-07-19 13:07:33 +01:00