From 11ad4a447618b37e2e0d7c1ffe0153958febcf33 Mon Sep 17 00:00:00 2001 From: eduard93 Date: Sat, 14 Mar 2020 23:19:00 +0300 Subject: [PATCH] Added exchange optional parameter. Restores commit https://github.com/intersystems-ru/RabbitMQ-Ensemble-adapter/commit/e9c6112ec611edd4ccd195e6ac161b332255be09 --- isc/rabbitmq/Common.cls | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/isc/rabbitmq/Common.cls b/isc/rabbitmq/Common.cls index 9c32db5..00ae484 100644 --- a/isc/rabbitmq/Common.cls +++ b/isc/rabbitmq/Common.cls @@ -9,8 +9,16 @@ Property Port As %Integer [ InitialExpression = -1 ]; Property VirtualHost As %String [ InitialExpression = "/" ]; +/// Outbound adapter only (ignored for inbound adapter) +/// If Exchange is not set, then Queue name. +/// If Exchange is set, then Routing Key. Property Queue As %String; +/// Exchange name. +/// Optional, empty by default. +/// If set, Queue becomes Routing Key. +Property Exchange As %String; + /// Config Name of the Java Gateway service controlling the Java Gateway server this item will use. /// Alternatively use JGHost and JGPort Settings, to specify Java gateway outside of Ensemble scope. Property JGService As %String; @@ -40,7 +48,7 @@ Property Encoding As %String; Property ClassPath As %String(MAXLEN = 32000); /// These are the production settings for this object -Parameter SETTINGS = "Host:Basic,Port:Basic,VirtualHost:Basic,Queue:Basic,Credentials:Basic:credentialsSelector,JGHost:Java Gateway,JGPort:Java Gateway,JGService:Java Gateway:selector?context={Ens.ContextSearch/ProductionItems?targets=0&productionName=@productionId},ClassPath:Basic,Encoding:Basic"; +Parameter SETTINGS = "Host:Basic,Port:Basic,VirtualHost:Basic,Queue:Basic,Exchange:Basic,Credentials:Basic:credentialsSelector,JGHost:Java Gateway,JGPort:Java Gateway,JGService:Java Gateway:selector?context={Ens.ContextSearch/ProductionItems?targets=0&productionName=@productionId},ClassPath:Basic,Encoding:Basic"; /// Connect to running JGW Method Connect() As %Status @@ -82,7 +90,7 @@ Method ConnectToRabbitMQ() As %Status } Try { - Set ..API = ##class(isc.rabbitmq.API).%New(..JGW, ..Host, ..Port, user, pass, ..VirtualHost, ..Queue, $$$YES) + Set ..API = ##class(isc.rabbitmq.API).%New(..JGW, ..Host, ..Port, user, pass, ..VirtualHost, ..Queue, $$$YES, ..Exchange) } Catch ex { Set sc = ..ExceptionToStatus(ex) }