Support default exchange routing in Basic_publish
This commit is contained in:
parent
5f250c7f90
commit
560febdea3
|
@ -336,9 +336,14 @@ let handle_method conn channel m =
|
||||||
| Basic_publish (exchange, routing_key, false, false) ->
|
| Basic_publish (exchange, routing_key, false, false) ->
|
||||||
lwt (_, (body_size, properties)) = next_header conn in
|
lwt (_, (body_size, properties)) = next_header conn in
|
||||||
lwt body = recv_content_body conn body_size in
|
lwt body = recv_content_body conn body_size in
|
||||||
|
let (pseudotype, sink, name) =
|
||||||
|
if exchange = ""
|
||||||
|
then ("Queue", routing_key, "")
|
||||||
|
else ("Exchange", exchange, routing_key)
|
||||||
|
in
|
||||||
(match_lwt
|
(match_lwt
|
||||||
Node.post' exchange
|
Node.post' sink
|
||||||
(Sexp.Str routing_key)
|
(Sexp.Str name)
|
||||||
(Sexp.Hint {Sexp.hint = Sexp.Str "amqp";
|
(Sexp.Hint {Sexp.hint = Sexp.Str "amqp";
|
||||||
Sexp.body = Sexp.Arr [Sexp.Str exchange;
|
Sexp.body = Sexp.Arr [Sexp.Str exchange;
|
||||||
Sexp.Str routing_key;
|
Sexp.Str routing_key;
|
||||||
|
@ -347,7 +352,7 @@ let handle_method conn channel m =
|
||||||
(Sexp.Str "")
|
(Sexp.Str "")
|
||||||
with
|
with
|
||||||
| true -> return ()
|
| true -> return ()
|
||||||
| false -> send_warning conn not_found ("Exchange "^exchange^" not found"))
|
| false -> send_warning conn not_found (pseudotype^" '"^sink^"' not found"))
|
||||||
| Basic_ack (delivery_tag, multiple) ->
|
| Basic_ack (delivery_tag, multiple) ->
|
||||||
return ()
|
return ()
|
||||||
| _ ->
|
| _ ->
|
||||||
|
|
Loading…
Reference in New Issue