set_message_properties(Props, Msg) ->
maps:fold(fun(delivery_mode, 2, M) ->
amqp10_msg:set_headers(#{durable => true}, M);
(content_type, Ct, M) ->
amqp10_msg:set_properties(
#{content_type => rabbit_data_coercion:to_binary(Ct)}, M);
(_, _, M) -> M
end, Msg, Props).
[%% A named shovel worker.
{ism_tvcrecognition_shovel,
[
%% List the source broker(s) from which to consume.
%%
{source,
[
{protocol, amqp091},
{uris, ["amqp://"]},
{queue, <<"ism.tvcrecognition-q">>},
{declarations, [
{'exchange.declare',
[ {exchange, <<"ism.tvcrecognition-x">>},
{type, <<"direct">>},
durable
]},
{'queue.declare',
[{queue, <<"ism.tvcrecognition-q">>},
{arguments,
[{<<"x-message-ttl">>, long, 60000}]}
]},
{'queue.bind',
[ {exchange, <<"ism.tvcrecognition-x">>},
{queue, <<"ism.tvcrecognition-q">>},
{routing_key,<<"ism.tvcrecognition">>}
]}
]}
]},
%% List the destination broker(s) to publish to.
%%
{destination,
[
{protocol, amqp10},
{uris, ["amqps://<REDACTED>:<REDACTED>@<REDACTED>.servicebus.windows.net:5671?versions=tlsv1.2"]},
{add_forward_headers, true},
{add_timestamp_header, true},
{target_address, <<"ism-sbt-tvcrecognition">>},
{application_properties, [{<<"MyNameIs">>, <<"James">>}]},
{properties, [
{group_id, <<"1">>},
{subject, <<"SendHashForMatching">>},
{content_encoding, <<"UTF-8">>}
]}
]}
]}, %% End of ism_tvcrecognition_shovel
================================================================================
2019-05-22 1:43:40:939: Message published
Node: rabbit@<REDACTED>
Connection: 172.17.0.1:36970 -> 172.17.0.2:5672
Virtual host: /
User: guest
Channel: 1
Exchange: ism.tvcrecognition-x
Routing keys: [<<"ism.tvcrecognition">>]
Routed queues: [<<"ism.tvcrecognition-q">>]
Properties: [{<<"app_id">>,longstr,<<"ism.tvcrecognition">>},
{<<"message_id">>,longstr, <<"dee0c4da-302f-40b0-abe3-de8ae4f908bf">>},
{<<"correlation_id">>,longstr, <<"dee0c4da-302f-40b0-abe3-de8ae4f908bf">>},
{<<"delivery_mode">>,signedint,2},
{<<"headers">>,table,
[{<<"BodyEncoding">>,longstr,<<"Amqp">>},
{<<"ChannelId">>,long,21},
{<<"Environment">>,longstr,<<"dev">>},
{<<"MessageHandlerType">>,longstr,<<"SendForMatching">>},
{<<"Originator">>,longstr,<<"ism.tvcrecognition">>},
{<<"RegionId">>,long,1},
{<<"Source">>,longstr,<<"RAVEL">>},
{<<"VersionBuild">>,signedint,0},
{<<"VersionMajor">>,signedint,0},
{<<"VersionMinor">>,signedint,0}]},
{<<"content_encoding">>,longstr,<<"UTF-8">>},
{<<"content_type">>,longstr,<<"application/json">>}]
Payload:
{<REDACTED>}
================================================================================--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/3eb4b642-f75a-4bd2-b3a3-b5228594b6ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
{destination,
[
{protocol, amqp10},
{uris, ["amqps://<REDACTED>:<REDACTED>@<REDACTED>.servicebus.windows.net:5671?versions=tlsv1.2"]}, {add_forward_headers, true},
{add_timestamp_header, true},
{target_address, <<"ism-sbt-tvcrecognition">>},
{properties, [
{correlation_id, GetSourcePropertyValue("message_id"), %% <<== Correlation ID set Dynamically from incoming standard message property ?
group_id, GetSourceApplicationPropertyValue("region_id")} %% <<== Session ID set Dynamically from incoming application message property ?
]}
]}
]}
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/07aa91db-c0ff-4295-a1f5-d5036c4fc3dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
set_message_properties(Props, Msg) ->
maps:fold(fun(delivery_mode, 2, M) ->
amqp10_msg:set_headers(#{durable => true}, M);
(message_id, Ct, M) ->
amqp10_msg:set_properties(
#{message_id => rabbit_data_coercion:to_binary(Ct)}, M);
(correlation_d, Ct, M) ->
amqp10_msg:set_properties(
#{correlation_d => rabbit_data_coercion:to_binary(Ct)}, M);
(content_encoding, Ct, M) ->
amqp10_msg:set_properties(
#{content_encoding => rabbit_data_coercion:to_binary(Ct)}, M);
(delivery_mode, Ct, M) ->
amqp10_msg:set_properties(
#{delivery_mode => rabbit_data_coercion:to_binary(Ct)}, M);
(priority, Ct, M) ->
amqp10_msg:set_properties(
#{priority => rabbit_data_coercion:to_binary(Ct)}, M);
(reply_to, Ct, M) ->
amqp10_msg:set_properties(
#{reply_to => rabbit_data_coercion:to_binary(Ct)}, M);
(type, Ct, M) ->
amqp10_msg:set_properties(
#{type => rabbit_data_coercion:to_binary(Ct)}, M);
(app_id, Ct, M) ->
amqp10_msg:set_properties(
#{app_id => rabbit_data_coercion:to_binary(Ct)}, M);
(content_type, Ct, M) ->
amqp10_msg:set_properties(
#{content_type => rabbit_data_coercion:to_binary(Ct)}, M);
(cluster_id, Ct, M) ->
amqp10_msg:set_properties(
#{cluster_id => rabbit_data_coercion:to_binary(Ct)}, M);
(headers, Ct, M) ->
amqp10_msg:set_properties(
#{headers => rabbit_data_coercion:to_binary(Ct)}, M);
(_, _, M) -> M
end, Msg, Props).
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitm...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/07aa91db-c0ff-4295-a1f5-d5036c4fc3dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Karl Nilsson
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/14ee446f-a471-437f-b294-8420e8fc4b5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.