...
Now save the editor input (e.g. with CTRL-S) and run the query by using Execute Script (e.g. by right clicking on the file in the project explorer, on the editor it self or by using the button in the toolbar)
If all is correct, there will be a new source in the source-view.
Now remove the source again by clicking on the . It will remove all current sources. A single source can be removed by right clicking on that source and choosing: Drop Source.
The other sources are created the same way. To go further, add the following to the NexmarkSource editor (after the definition of the person source) and execute the script.
Code Block |
---|
nexmark:bid ::= ACCESS({source='nexmark:bid',
wrapper='GenericPush',
transport='TCPClient',
protocol='SizeByteBuffer',
dataHandler='Tuple',
options=[
['host', 'localhost'],
['port', '65442'],
['ByteOrder', 'LittleEndian']
],
schema=[
['nexmark:bid','timestamp', 'STARTTIMESTAMP'],
['nexmark:bid','auction', 'INTEGER'],
['nexmark:bid','bidder', 'INTEGER'],
['nexmark:bid','datetime', 'LONG'],
['nexmark:bid','price', 'DOUBLE']
]
})
nexmark:auction ::= ACCESS({source='nexmark:auction',
wrapper='GenericPush',
transport='TCPClient',
protocol='SizeByteBuffer',
dataHandler='Tuple',
options=[
['host', 'localhost'],
['port', '65441'],
['ByteOrder', 'LittleEndian']
],
schema=[
['timestamp', 'STARTTIMESTAMP'],
['id', 'INTEGER'],
['itemname', 'STRING'],
['description', 'STRING'],
['initialbid', 'INTEGER'],
['reserve', 'INTEGER'],
['expires', 'LONG'],
['seller', 'INTEGER'],
['category', 'INTEGER']
]
})
nexmark:category ::= ACCESS({source='nexmark:category',
wrapper='GenericPush',
transport='TCPClient',
protocol='SizeByteBuffer',
dataHandler='Tuple',
options=[
['host', 'localhost'],
['port', '65443'],
['ByteOrder', 'LittleEndian']
],
schema=[
['id', 'INTEGER'],
['name', 'STRING'],
['description', 'STRING'],
['parentid', 'INTEGER']
]
}) |
After that you see a list of four sources in the source view:
To test, if everthings is connected correctly, right click on System.nexmark:person and choose Show data:
A new window should with person events should open. If your using the standard configuration of nexmark, it takes 5 seconds before the first event occures. Then every 5 second a new person will be shown.
Your window should look somehow like this:
Now close the window by clicking on .
If you choose show data again, the source will be beginning from start(but only if no other connection to the nexmark-server is open, e.g. via bids).