...
Code Block |
---|
#PARSER PQL #REQUIRED de.uniol.inf.is.odysseus.wrapper.rabbitmq.feature #RUNQUERY input = ACCESS({ transport='RabbitMQ', source= 'Receiver', wrapper='GenericPush', protocol='SimpleCSV', datahandler='Tuple', options=[ ['EXCHANGE_NAME','TelCoSim'], ['QUEUE_NAME','DataUsage'], ['CONSUMER_TAG','Odysseus'], ['HOST','localhost'], ['ByteOrder', 'Little_Endian'], ['csv.delimiter',';'] ], schema=[ ['TIMESTAMP', 'STARTTIMESTAMP'], ['id', 'String'], ['volume', 'Long'] ] } ) |
See https://git.swl.informatik.uni-oldenburg.de/projects/ODYDATGEN/repos/telcosim/browse/src/main/java/de/uniol/inf/is/telCoSim/Simulation.java how the data is generated for this input queue.
See RabbitMQ use case for an example how to connect external software with Odysseus via RabbitMQ.
Send and Receive with RabbitMQ
Here is a simple example where content is send to RabbitMQ and received with Odysseus again.
Code Block |
---|
#PARSER PQL
#ADDQUERY
timer = TIMER({PERIOD = 1000, SOURCE = 'timersource'})
SENDER = SENDER({
transport='RabbitMQ',
wrapper='GenericPush',
protocol='csv',
datahandler='Tuple',
SINK="SENDER",
options=[
['QUEUE_NAME','nexmark'],
['CONSUMER_TAG','bid'],
['HOST','localhost']
]
},
timer
) |
Receiver
Code Block |
---|
#PARSER PQL
#REMOVEQUERY A
#QNAME A
#RUNQUERY
input = ACCESS({
transport='RabbitMQ',
source= 'Receiver',
wrapper='GenericPush',
protocol='csv',
datahandler='Tuple',
options=[
['QUEUE_NAME','nexmark'],
['CONSUMER_TAG','bid'],
['HOST','localhost'],
['ByteOrder', 'LittleEndian']
],
schema=[['time', 'StartTimestamp']]
} |