Artem,
Proton uses a non-blocking, reactive model. I think you need to also
have such a model for whatever database you are interfacing to.
For the sending case (i.e. live data to a consumer), you need to have
something like an onData function that is invoked when the cursor has
more data to consume. This can then check the outgoing credit and
transfer the data if there is sufficient credit. Likewise, when you get
credit (onLinkFlow) from a consumer, you need to have a non-blocking way
to query the cursor to see if it has more data.
With this model, live-data is controlled by onLinkFlow (you can transfer
data to the consumer) and onData (there is new data to transfer). This
can scale to large numbers of cursors and consumers.
I hope this is helpful.
-Ted
On 07/08/2016 02:50 PM, Artem wrote:
Robbie,
Now i have a big broker server and now i want to support AMQP 1.0 protocol
and one of the best options that I found - is to use a Qpid Proton J.
I`m read examples how use Proton and write this work model of my server:
1)When i have event "onLinkRemoteOpen" - i`m create connection to my
database(it`s a cursor), and mapped it with the Link.
2)When i have event "onLinkFlow" - i get message from cursor and do
Sender.send(message). Then
it should be "onTransport" event. The specification of AMQP 1.0 says that
for each "onTransport" event will be return "onLinkFlow" event. Working on
this principle the server sends a large number of messages.
Cursor like iterator have 2 methods: next() and getMessage(). Cursor can
work at 2 modes: live and simple. At simple mode it read all data from DB
and then close. *But at live mode when data run out in the database and i
call cursor.next() - cursor waiting for data as long as they are not
written in database.* (I can waiting data in other thread.) In this way
while live cursor waiting data other links are not processing by the server.
And the second problem is that, how to send Heartbeat frame to user that
waiting live data?
How i can change this model of my server to support live data?
Artem
--
View this message in context:
http://qpid.2158936.n2.nabble.com/Broker-with-live-data-tp7647047p7647123.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]