Trouble with Gateway Message from 7.9 to 8.0

We’re looking into a project where we’d like to leverage 8.0 but decouple some of the functionality from the existing 7.9 system. To do this, we’d like to send gateway messages from the 7.9 gateway to the 8.0 gateway. I’ve successfully established a gateway network connection outgoing from 8.0 to 7.9 and all seems to function well–I can even add the 7.9 tag provider to the 8.0 gateway via Remote Tag Provider.

Here is some baseline context:

  • Ignition 8.0 Gateway
    • Version: 8.0.9
    • Hostname: eightoh
    • Ignition Gateway Name: Ignition-eightoh
    • Project Name: EightOhTest
    • Message Handler Name: UpdateTime
  • Ignition 7.9 Gateway
    • Version: 7.9.13
    • Hostname: sevennine
    • Ignition Gateway Name: Ignition-sevennine
    • Project Name: SevenNineTest

When I attempt to send a gateway message from the 7.9 gateway (via the Designer, in R/W mode) with the script below:

results = system.util.sendMessage(project="EightOhTest", messageHandler="UpdateTime", remoteServers=['Ignition-eightoh'])

… I get a sendStatus=SENT and the message seems to go out the door. On the 8.0 gateway, however, I get an error in the logger from metro.Intent (error is the same even if I change the project or messageHandler variables to invalid values in the msg send, so it appears to be at a level before the message is delivered to a given project’s handler):

Intent	25Feb2020 09:18:58	Unhandled Intent failure.
java.io.StreamCorruptedException: invalid type code: FF
at java.base/java.io.ObjectInputStream.readObject0(Unknown Source)
at java.base/java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.base/java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.base/java.io.ObjectInputStream.readObject0(Unknown Source)
at java.base/java.io.ObjectInputStream.readObject(Unknown Source)
at java.base/java.util.concurrent.ConcurrentHashMap.readObject(Unknown Source)
at java.base/jdk.internal.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at java.base/java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.base/java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.base/java.io.ObjectInputStream.readObject0(Unknown Source)
at java.base/java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.base/java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.base/java.io.ObjectInputStream.readObject0(Unknown Source)
at java.base/java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.base/java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.base/java.io.ObjectInputStream.readObject0(Unknown Source)
at java.base/java.io.ObjectInputStream.readObject(Unknown Source)
at com.inductiveautomation.metro.impl.codecs.JavaSerializationCodec.decode(JavaSerializationCodec.java:41)
at com.inductiveautomation.metro.impl.CentralManagerImpl.handleLocal(CentralManagerImpl.java:432)
at com.inductiveautomation.metro.impl.ConnectionWatcher.handle(ConnectionWatcher.java:424)
at com.inductiveautomation.metro.impl.ConnectionWatcher.handle(ConnectionWatcher.java:43)
at com.inductiveautomation.metro.impl.protocol.websocket.WebSocketConnection.forward(WebSocketConnection.java:1407)
at com.inductiveautomation.metro.impl.protocol.websocket.WebSocketConnection$RunDownload.run(WebSocketConnection.java:1965)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

Has anyone else had success using gateway messaging between a 7.9 and 8.0 gateway?

Thanks in advance for any insights!

I’m pretty sure this is a bug that there’s active PRs up for. Scanning through those, looks like changes need to happen in both 7.9 and 8.0, so you’ll have to update both sides once changes are accepted.

Right now the PRs are targeting 7.9.14 and 8.0.10, but that’s subject to change :train:

@kcollins We needed the same functionality but could not wait for the aforementioned fix. I our case we have two central gateways (one 7.9 and one 8.0) and a bunch of spokes that are 7.9 that I used to message to via the 7.9 central gateway. To make the messaging from 8.0 work, I tag write a dataset tag to the 7.9 central gateway and on a tag change event it reads the dataset and sends a message to the 7.9 spoke targeted by the dataset (7.9 to 7.9). It works well but does require that the 8.0 gateway has read, write permissions to the 7.9 central gateway.

1 Like

@weertske, seems reasonable. We ended up concluding that at least for our proposed system, we could implement the equivalent functionality by putting WebDev on the 8.0 gateway and using HTTP requests (from the 7.9 gateway) for message exchange upstream. Not nearly as clean/simple as the built-in gateway messaging, but would let us get the job done in a way that could fairly easily be substituted with gateway messaging later down the road.

Thanks for sharing that solution path as well!

1 Like

FWIW - the changes just made it into 8.0.11 (will also likely be in 7.9.14). The gist is basically the approach @kcollins described; if a different major platform version is detected the payload is serialized to ‘plain’ JSON for exchange. It’s not perfect - you may have to manually handle ‘serializing’ more complex Java objects, if they’re not JSON primitives, but the groundwork’s already there.

Did the fix make it into 7.9.14? I do not see any mention of messaging in the release notes.

Yes, it did. It got skipped in our release note process for some technical reasons, but the changes are in 7.9.14.