从 Mirth Connect 将值设置到 JMS 标头中?

问题描述 投票:0回答:1

我正在使用 mirth connect 3.3,在将值从 mirth connect transformer 设置到 JMS 标头时遇到问题。我正在设置如下值:

var map = Packages.org.mule.impl.RequestContext.getEventContext().getProperties();
map.put('key','value');

但是出现这个错误:

TypeError: Cannot call property getProperties in object [JavaPackage org.mule.impl.RequestContext]. It is not a function, it is "object".
at 22f9d2db-a1f5-4e4e-99f9-78e93d3b6135:57 (doTransform)
at 22f9d2db-a1f5-4e4e-99f9-78e93d3b6135:85 (doScript)
at 22f9d2db-a1f5-4e4e-99f9-78e93d3b6135:87
at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.call(JavaScr iptFilterTransformer.java:154)
at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.call(JavaScr iptFilterTransformer.java:119)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
at java.lang.Thread.run(Unknown Source)

有没有其他方法可以将值设置到 JMS 标头中,以便我可以通过消息在 sonic 上获取它?

header jms mirth
1个回答
0
投票

举个例子。 https://github.com/samoanGuy7/mirth-connect-JMS-sender-with-headers/blob/main/JMS%20file%20sender%20with%20headers

这段代码应该特别有趣:

        //Setting a property on the message(message is a data type in activemq, not just a string), not currently supported by mirth connect natively
        //https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/Message.html
        message.setType("someType");
        producer.send(message);

您可以点击上面的链接来参考文档。

© www.soinside.com 2019 - 2024. All rights reserved.