Developing a bi-directional gateway
NATS sends a bunch of bytes around, but Tuxedo requests and responses carry around more information. For both systems to communicate seamlessly, we have to advance NATS messages:
- Requests in Tuxedo have flags such as
TPTRAN
andTPNOREPLY
that indicate that the service call is a part of a global transaction and that no response is expected from the service. NATS does not support transactions, so we do not need theTPTRAN
flag, butTPNOREPLY
is useful. - Tuxedo supports multiple typed buffers. We could find a way to encode
CARRAY
,STRING,
andFML32
messages but for simplicity, we will support onlyFML32
messages that are sent as Python dictionaries. - Responses in Tuxedo have the
rval
,rcode
, anddata
fields, and we will need them all in our gateway.
To include all extra information in NATS messages, we will use JSON data converted to bytes. The service request will have the following format:
{"flags":"TPNOREPLY...