getServiceResourceResolver with unique name | Community
Skip to main content
New Participant
Jun 3, 2019 1:33 PM UTC
Solved

getServiceResourceResolver with unique name

Hi to all,

we are using ResourceResolverFactory.getServiceResourceResolver from different threads and different event listener with a identical identifier, e.g.

Map<String, Object> authenticationProperties = new HashMap<>();

authenticationProperties.put(ResourceResolverFactory.SUBSERVICE, "our_id");

ret = resourceResolverFactory.getServiceResourceResolver(authenticationProperties);

We don't share the service resource resolver between thread or listeners. Every call to the listener or every thread calls the code snippet from above to get his own SRR and is closing the SRR when work is done.

Is this possible without running into problems when a thread or a event will be fired in parallel?

Or should we use different identifiers for event listener A, event listener B, background thread A, ...

Thanks

Uwe

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
joerghoh
joerghohAccepted solution
Employee
Jun 3, 2019 9:10 PM UTC

AFAIK the subservice ID does not have to be unique, that means you can use the same snippet for multiple times.

Jörg

1 reply

joerghoh
joerghohAccepted solution
Employee
Jun 3, 2019 9:10 PM UTC

AFAIK the subservice ID does not have to be unique, that means you can use the same snippet for multiple times.

Jörg

Translate