Yes, there is only one onConnectionBound event, when the connection
object is initially bound to the transport object. You can create a
session later by doing it in essentially any callback, the main
concern is purely that the work is performed on the thread running the
reactor, as all your existing usage must similarly do for sending
messages etc over time. As I noted on the JIRA, if you need to provoke
work on the reactor thread from elsewhere you could perhaps achieve
that by calling the reactor wakeup method if you are in another thread
and then having an onReactorQuiesced handler somewhere which is able
to pick up the task of doing the new work on the reactors, or perhaps
just schedule your own timer task that picks it up periodically, or
you could create your own selectable() that acts similarly to the
wakeup and timer mechanisms provided. There isn't a specific example
of multiple sessions, but its little different from others uses of the
reactor, you can glean the details needed from the existing examples
and/or looking at the code itself, thats essentially what I've done to
give these suggestions.

Robbie

On 10 February 2018 at 00:09, Priyanka Mathur
<prmat...@microsoft.com.invalid> wrote:
>
> My concern with creating new sessions dynamically is that, we never get 
> onConnectionBound -> where we start a session on the existing connection once 
> connection is established. Is there a sample or some piece of code that 
> explains how to use the reactor so that we can create a new session on demand 
> ?
>
> [I'm not sure if this is the right group to message these kind of questions 
> to. If not can you forward it to appropriate group ?]
>
> -Priyanka
>
> -----Original Message-----
> From: Robbie Gemmell (JIRA) <j...@apache.org>
> Sent: Friday, February 2, 2018 10:04 AM
> To: Priyanka Mathur <prmat...@microsoft.com>
> Subject: [jira] [Closed] (PROTON-1755) How do create sessions and links 
> dynamically once the connection is open ?
>
>
>      [ 
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fissues.apache.org%2Fjira%2Fbrowse%2FPROTON-1755%3Fpage%3Dcom.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel&data=02%7C01%7Cprmathur%40microsoft.com%7Cdf9acefa099543dad4b908d56a675981%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636531914481922617&sdata=oDNzXrrrMnz8DY%2FC9Q5DUVYMQMnIhlkxb7tCw6IHc7E%3D&reserved=0
>  ]
>
> Robbie Gemmell closed PROTON-1755.
> ----------------------------------
>     Resolution: Not A Bug
>
> As mentioned before, please use the mailing lists for questions, not the 
> issue tracker.
>
> You would add any new sessions/links in essentially the same manner as you 
> added previous ones, and the event flow would be interweaved for the 
> different sessions/links based on what happens on the wire.
>
> The main concern is just that, like every other use of the reactor, youd need 
> to do it on the thread running the reactor, e.g by calling the reactor wakeup 
> and having an onReactorQuiesced handler somewhere able to pick up the task of 
> doing the new work, or having your own timer task that picks it up, or your 
> own selectable thing, etc.
>
>> How do create sessions and links dynamically once the connection is open ?
>> ----------------------------------------------------------------------
>> ----
>>
>>                 Key: PROTON-1755
>>                 URL: 
>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fissues.apache.org%2Fjira%2Fbrowse%2FPROTON-1755&data=02%7C01%7Cprmathur%40microsoft.com%7Cdf9acefa099543dad4b908d56a675981%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636531914481922617&sdata=z7ua%2BRszoqKAe6gwXc%2FEBx6hfr1g4CP3daiBGAAsIeI%3D&reserved=0
>>             Project: Qpid Proton
>>          Issue Type: Bug
>>          Components: proton-j
>>    Affects Versions: proton-j-0.25.0
>>            Reporter: Priyanka Mathur
>>            Priority: Major
>>
>> Hi Proton-j folks,
>> We use proton-j library for establishing a connection and
>> sending/receiving messages over it.Until now we never had the need to
>> *add* a new session or new link to an existing and *opened*
>> connection. Now that we have multiplexing, we have the need to add a
>> new session (and)/or add a new link to already existing and opened
>> connection. My question is how do I do that ? Once we start the
>> reactor, we receive several callbacks and callbacks of importance here are 
>> 1. onConnectionInit 2. onConnectionBound -> we start a session 3. onLinkInit 
>> -> we start a link 4. onLinkRemoteOpen -> we check if link has opened and 
>> the connection is now established.
>> Question is now that connection is opened, how do I add a new session
>> to the already opened connection ?
>> how do I add a new link to the already opened session ?
>> Is there any such support from proton-j ? As AMQP protocol clearly should 
>> support it.
>>
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v7.6.3#76005)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
> For additional commands, e-mail: users-h...@qpid.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org

Reply via email to