StreamReceiver is a JMS message producer that listens to an InputStream and reads the bytes out of the stream, parses them into a message and puts the message to the output XQueue. StreamReceiver supports flow control and allows object control from its owner. It is fault tolerant with retry and idle options.
StreamReceiver supports various types of stream based data sources, in terms of the scheme such as tcp, comm and file. The operations of read and respond are supported. For example, it can be used to receive messages from a serial port.
Apart from the common properties, there are many implementation specific properties for StreamReceiver.
Property Name | Data Type | Requirement | Description | Examples |
---|---|---|---|---|
SOTBytes | string | optional | hex string for start of transmition | |
EOTBytes | string | optional | hex string for end of transmition | 0x0a |
Offhead | integer | optional | number of chars to be trimed off at the start | 0 |
Offtail | integer | optional | number of chars to be trimed off at the end | 1 |
Here is an example of StreamReceiver:
{ "Name": "rcvr_serial", "ClassName": "org.qbroker.receiver.StreamReceiver", "URI": "comm:///dev/term/a", "Device": "/dev/term/a", "LinkName": "root", "Operation": "read", "XAMode": "0", "TextMode": "1", "Mode": "daemon", "BufferSize": "4096", "SOTBytes": "0x01", "EOTBytes": "0x04", "BaudRate": "9600", "DataBits": "8", "StopBits": "1", "Parity": "None", "DisplayMask": "4" }where it reads the byte off the serial port of /dev/term/a.