Mind map
JMS
Map content
JMS
Messaging
- exchange data across applications or components inside an app
components
- sender
- receiver
- message
- sent using JNDI
- MOM (Messaging server)
- Message Oriented Middleware
- can persist messages to avoid lost them (difference whe using WS)
- reduce system bottleneck by using JMS provider (Multiple subscription using asyn)
- JMS provider
- which implements JMS specifications
- options
- ActiveMQ
- Websphere MQ
- Sonic MQ
- Tibco MQ
- Security
- apacheMQ
- allow to set users and roles
- artemis-user.properties
- artemis-roles.properties
- broker.xml
- allow to set users and roles
- apacheMQ
- Message Oriented Middleware
2 types of messages models
- point to point
- uses JMS provider to fullfill messaging rules
- messages can be consumed once through a queue
- synchronization
- asyn
- fire and forget (send message)
- Should use MessageListener to catch and also resply a message
- sync
- request/reply messaging
- can use a different queue to reply
- request/reply messaging
- asyn
- Queue
- expiryQueue
- storage all the messages which has exceed its life time
- can handle multiple queues
- queueBrowser
- allows us to get a snapshot of the queue content
- can be dinamically created
- expiryQueue
- publish / subscribe
- uses topic to broadcast the message
- topic is a virtual channel
- durable subscriptions
- mechanism that allow the consumer to get messages even is inactive, down etc
- sharedConsumer
- Allow us to define multiple consumers pointing to the same topic
- uses topic to broadcast the message
- point to point
versions
- JMS 1.X
- components
- connection
- session
- message
- message producer
- message consumer
- Destination
- Connection Factory
- configuration
- add client dependency
- artemis-jms-client-all
- add JNDI properties file
- must include 2
- connection factory
- initial factory
- also the queue or topic details
- must include 2
- add client dependency
- communication types
- P2P
- steps
- send message
- create connection
- session
- lookup for destination
- send and receive message
- receive message
- send message
- Queue browser
- allow us to search a specific message
- steps
- Publish/Subscription
- need to create multiple consumers located in different hosts
- need a consumer once the session is ready
- P2P
- components
- JMS 2
- components
- JMSContext
- handle by itself the creation of connection and session
- JMS Producer
- implements java.lang.Autocloseable interface(try block close this resource automatically)
- provides methods to easyly handle headers, body and message in gral
- JMSConsumer
- implements java.lang.Autocloseable interface
- provides methods to easyly handle headers, body and message in gral
- JMSContext
- new features
- allow the injection of connection factory using the tag @JMSConnectionFactory
- lookup can be achived by tag using as well
- Allow to implement custum connection Factory using annotations or XML
- message
- structure
- headers
- metadata
- 2 types
- provider
- developer
- properties
- 2 types
- Application specific
- provider specific
- 2 types
- body/payload
- contains data only
- headers
- capabilities
- set priority
- through the producer
- Higher priority, First out
- default priority is 4
- reply
- using header "replyTo"
- id
- set an id in the header
- setTimetoLive
- set priority
- types
- Text
- byte
- object (can be serialized)
- stream
- map
- Filtering
- use selectors
- can consider
- properties
- header
- DeliveryMode
- Priority
- MessageID
- CorrelationID
- Type
- uses the SQL syntanxis
- can consider
- use selectors
- Message Acknowledgements
- confirmation from JMS SERVER to producer or consumer about msg delivered.
- modes
- auto ack
- handle all the ack automatically
- OOO Once and only once
- dups
- JMS Server
- send the message more than once(can duplicate msg)
- is not blocked (consumer should reply)
- consumer
- should be ready to handle duplicate msgs
- the ack msg is automatically handled
- be aware of performance
- JMS Server
- client
- have to handle delivery acknowledgement (message.acknowledge() )
- if not, the msg will stay in the queue until client send ack.
- have to handle delivery acknowledgement (message.acknowledge() )
- auto ack
- differents contract between producer WITH server AND server WITH consumer to ensure msg delivery
- transaction
- producer
- can send multiple msg inside transactions
- need to notify transactions are over, using commit()
- consumer
- receive multiple transaction
- NEED TO confirm delivered transaction sending commit()
- server
- stores transactions inside cash whie wainting for commit()
- enabled in the context
- producer
- structure
- components
- JMS 1.X
Images and files in the map
Information
- Description
- Mind Map on JMS, created by Jorge Celis on 16/01/2020.
- Created by
- Jorge Celis
- Views
- 0
- Rating

