Difference in JavaGateway handling of %GlobalBinaryStream / byte[] between InterSystems IRIS 2018.1.2 and 2019.1

 I have two local instances:

  • IRIS for Windows (x86-64) 2018.1.2 (Build 626_3U) Wed Jun 12 2019 19:07:59 EDT
  • IRIS for Windows (x86-64) 2019.1 (Build 510U) Thu Mar 14 2019 14:13:37 EDT

I'm using Java Gateway to talk to external system.

Both instances are using the same:

  • jar
  • generated class
  • java version


They are calling the same method with this java signature:

package isc.rabbitmq;
public class API {
    public void sendMessage(byte[] msg) throws Exception {}
}

On the InterSystems IRIS side I'm calling it like this:

set sc = ##class(%Net.Remote.Service).OpenGateway(gatewayName, .gatewayConfig)
set sc = ##class(%Net.Remote.Service).ConnectGateway(gatewayConfig, .gateway, "PATH-TO-JAR", 1)
set api = ##class(isc.rabbitmq.API).%New(gateway)
set stream = ##class(%GlobalBinaryStream).%New()
do stream.Write(123456)
d api.sendMessage(stream)

And the method works for IRIS 2018.1.2, however on IRIS 2019.1 the byte[] is NULL.

IRIS documentation is stating that %GlobalBinaryStream is a correct class to use:

Any ideas what changed?

  • 0
  • 0
  • 46
  • 0
  • 1

Answers

Solved.

Streams are not passed only for overloaded methods.

This does not work:


public class API {
    public void sendMessage(byte[] msg) throws Exception {}
    public void sendMessage(byte[] msg, String Id) throws Exception {}
}

However this does:

public class API {
    public void sendMessage(byte[] msg) throws Exception {}
    public void sendMessageId(byte[] msg, String Id) throws Exception {}
}