Skip to content

Commit e9c6112

Browse files
committed
Added exchange optional parameter
1 parent 505c69b commit e9c6112

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

RabbitMQ/Common.cls

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ Property Port As %Integer [ InitialExpression = -1 ];
99

1010
Property VirtualHost As %String [ InitialExpression = "/" ];
1111

12+
/// Outbound adapter only (ignored for inbound adapter)
13+
/// If Exchange is not set, then Queue name.
14+
/// If Exchange is set, then Routing key.
1215
Property Queue As %String;
1316

17+
/// Exchange name. Optional, empty by default.
18+
Property Exchange As %String;
19+
1420
/// Config Name of the Java Gateway service controlling the Java Gateway server this item will use.
1521
/// Alternatively use JGHost and JGPort Settings, to specify Java gateway outside of Ensemble scope.
1622
Property JGService As %String;
@@ -82,8 +88,8 @@ Method ConnectToRabbitMQ() As %Status
8288
}
8389

8490
Try {
85-
Set ..API = ##class(isc.rabbitmq.API).%New(..JGW, ..Host, ..Port, user, pass, ..VirtualHost, ..Queue, $$$YES)
86-
} Catch ex {
91+
Set ..API = ##class(isc.rabbitmq.API).%New(..JGW, ..Host, ..Port, user, pass, ..VirtualHost, ..Queue, $$$YES, ..Exchange)
92+
} Catch ex {
8793
Set sc = $$$ADDSC(ex.AsStatus(),$g(%objlasterror))
8894
}
8995

RabbitMQ/OutboundAdapter.cls

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Class RabbitMQ.OutboundAdapter Extends (Ens.OutboundAdapter, RabbitMQ.Common)
22
{
33

4+
Parameter SETTINGS = "Exchange:Basic";
5+
46
/// Establish gateway connection and init java API.
57
Method OnInit() As %Status
68
{

0 commit comments

Comments
 (0)