On 29 May 2018 at 12:52, akabhishek1 <[email protected]> wrote:
> Hi Robbie,
>
> I did testing with -
>
> SETTINGS:
> 1. Single javax.jms.Connection
> 2. With the use of above Connection object created --> 4 Session
>     --> and created 4 Consumer for each Session --> 4 Listner for each
> consumer

Again, I assume you mean 1 listener for each consumer as a consumer
can only have 1 listener.

> 3. With the use of above Connection object created --> 17 Session
>     --> Using all 17 session for Message Creation

I dont see a reason for doing for this.

> 4. With the use of above Connection object created --> 17 Session
>     --> and created 17 Producer for each Session --> Using all producer for
> sending message
>
> So in my application, there are 38 Session Objects (4 for consumer, 17 for
> Producer, 17 for Message creation). (Is it a good practice to have these
> many sessions?)

You dont need to have a Session for message creation and then a
seperate session for a Producer to send the message.You typically use
the same session for both creating and sending a message via a
producer on the session. Sstrictly speaking you can use a message
created using any session, the only restriction is on threading; a
session is single threaded.

If you have 17 threads sending concurrently, then having 17 producers
on their own session seems fine. If you have 1 thread sending, then
you only really need one session from a JMS perspective, but you can
use several if you like. I do seem to recall mention of ServiceBus
itself not supporting muliple producer/consumer links per session in
the past.

For the consumers, the above sounds reasonable, but it mostly depends
what you want. You could have the 4 consumers on 1 session if you like
(and the server allows). If you are using a MessageListener then how
many sessions you'll want depends largely on the concurrency you want.
Each session has a single delivery thread for message listeners, so if
you created 4 consumers on it they would be serialized in their
delivery by the session. By creating more sessions, you get more
delivery threads.

>
>
> ISSUE:
> I started the application on Friday "2018-05-25 16:43:10,078" and keep
> application idle running for 2.5 days.
> After 2.5 days in idle state, i did testing today morning "2018-05-29
> 09:05:47,853". I found below result.
>
>         1. Consumer worked fine;
>         2. But, Producer failed to send messages after 2.5 days;
>         (Logs at below location) -
> https://github.com/abhikt48/servicebus/blob/master/ErrorLogs
>
> What is making the Producer to fail? Is there some setting I have to do?
>

The logs dont contain the exception message, but the stracktrace point
to it complaining that the producer was closed previously.

You clipped the earlier information so its not possible to say when,
but they will show it being detached at some point.

>
> ADDITIONAL QUESTIONS:
>         1. Can/should I create separate Message producer for every message and
> dispose it once message sent successfully?

This is to be avoided in general, as its extremely inefficient to
create and destroy a producer for each message, and so unless your
throughput is minimal it will impact performance noticeably.

>         OR
>         2. Can/should I have multiple message producer(more than 17) with 
> single
> Session object? Is this a good practice?
>

Essentially answered above. You can have more than 1 producer on a
session if it suits your applications threading model (and assuming
the server actually supports it).

> Regards,
> Abhishek Kumar
>
>
>
> --
> Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html
>
> ---------------------------------------------------------------------
> 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]

Reply via email to