3

I just want to clarify is JwtConsumer thread safe? I'm going to use it with spring rest controller. Is it fine to use one consumer in whole application for multiple requests or better place it under request skope?

Normal
  • 1,347
  • 4
  • 17
  • 34

1 Answers1

4

Yes, JwtConsumer is thread safe as long as you are using a recent version and, if your using any additional validators or customizers, they are also thread safe.

There was previously an issue with thread safety but it was fixed in v0.4.3.

Brian Campbell
  • 2,293
  • 12
  • 13
  • 1
    Perhaps its worthy to add some javadoc to it, btw thank you very much) – Normal May 20 '16 at 11:09
  • I did actually add a bit about thread safety to the javadoc as a result of this question: https://bitbucket.org/b_c/jose4j/commits/22c9ea6fc4314daf80735dd8721f5ee331772cc0 – Brian Campbell May 22 '16 at 12:05