I was going through Payload Extractor pattern in Real World Java EE Patterns Rethinking Best Practices Adam Bien Book, the following code found.
MDB Bean class:
PayLoad Extractor Class:
the question is Logic of Payload extractor (extracting messages and invoke consume method) can be done in onMessage method itself. What is the use of this pattern?, i dont find any value added using this approach, can anyone please explain better?