Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About Default Message Listener Container [SPR-16464] #21009

Closed
spring-projects-issues opened this issue Feb 3, 2018 · 2 comments
Closed

About Default Message Listener Container [SPR-16464] #21009

spring-projects-issues opened this issue Feb 3, 2018 · 2 comments
Assignees
Labels
in: messaging status: invalid

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Feb 3, 2018

SWAPNIL UGARE opened SPR-16464 and commented

Hi All,

We created spring boot JMS application which listen MQ and process received message.when Message processing we have third party API call which does not support the asynchronous call API call.
We made third party API synchronized. so that it will thread safe and keep session.

When we push multiple messages in MQ that number of thread will create in our spring boot JMS application. all thread will work asynchronously when all thread reach to third party API call then it will wait still previous thread finish his work.

But third party API call will take more time because of that some JMS thread will expire or dead without throwing any exception.

Let we know which way we will keep alive messaging thread for long time or provide any alternative solution.


No further details from SPR-16464

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Feb 5, 2018

Juergen Hoeller commented

This is not a core framework issue, rather an architectural question. Please don't create such issues on JIRA here, in particular not as bugs with "blocker" level. You will be better off asking such a question on StackOverflow or a similar discussion forum.

Spring's DefaultMessageListenerContainer provides many options to fine-tune threading behavior. It does not stop with the out-of-the-box options: For long-running message processing steps, you could also spin off an asynchronous task to a custom (Task)Executor in your own listener endpoint, letting the JMS message consumer go back to the pool immediately. Spring's SimpleMessageListenerContainer even uses a specified taskExecutor exactly like that but is otherwise very limited in its customization options.

Note that with such asynchronous spin-offs in the listener endpoints, incoming messages will be acknowledged immediately. You might be better off with a regular setup, an appropriate concurrency level and correspondingly long timeouts for the JMS receive threads.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Feb 5, 2018

SWAPNIL UGARE commented

Thanks Juergen for reply,
I can not able to find any where to set custom Task Executor in spring which will give long running thread or task. let me know the reference.

@spring-projects-issues spring-projects-issues added status: invalid in: messaging type: task labels Jan 11, 2019
@spring-projects-issues spring-projects-issues removed the type: task label Jan 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: messaging status: invalid
Projects
None yet
Development

No branches or pull requests

2 participants