Presentation is loading. Please wait.

Presentation is loading. Please wait.

Harjutus 3: Aünkroonne hajussüsteemi päring

Similar presentations


Presentation on theme: "Harjutus 3: Aünkroonne hajussüsteemi päring"— Presentation transcript:

1 Harjutus 3: Aünkroonne hajussüsteemi päring
Kristjan Kuhi Märts 2010

2 Probleem Rakendus1 Rakendus2
© Ericsson Eesti AS 2010 | Public | Kristjan Kuhi |

3 Lahendus Sõnumivahetus (Messaging) Failivahetus Ühine andmebaas Mashup
Funktsiooni kaugväljakutse (Remote Procedure Invocation) Sõnumivahetus (Messaging) © Ericsson Eesti AS 2010 | Public | Kristjan Kuhi |

4 Sõnumivahetus Rakendus1 Rakendus2 Producer Consumer Channel
© Ericsson Eesti AS 2010 | Public | Kristjan Kuhi |

5 Messaging CHANNELS Pont-to-point (messages read once by a receiver)
Publish-subscribe(broadcast, multiple receivers) Allikas: G. Hohpe, B. Wolf “Enterprise Integration Patterns” 2003 © Ericsson Eesti AS 2010 | Public | Kristjan Kuhi |

6 Message oriented middleware (MOM)
Oracle Advanced Queuing (AQ) Microsoft MQ (MSMQ) IBM Websphere MQ Progress SonicMQ Apache ActiveMQ Sun OpenMQ Jboss Messaging ...... © Ericsson Eesti AS 2010 | Public | Kristjan Kuhi |

7 Messaging Bridge Allikas: G. Hohpe, B. Wolf “Enterprise Integration Patterns” 2003 © Ericsson Eesti AS 2010 | Public | Kristjan Kuhi |

8 Java Messaging System The Java Message Service (JMS) API is a Java Message Oriented Middleware (MOM) API for sending messages between two or more clients. JMS is a part of the Java Platform, Enterprise Edition Allikas: © Ericsson Eesti AS 2010 | Public | Kristjan Kuhi |

9 Mõisted Allikas: http://en.wikipedia.org/wiki/Java_Message_Service
JMS producer A JMS client that creates and sends messages. JMS consumer A JMS client that receives messages. JMS message An object that contains the data being transferred between JMS clients. JMS queue A staging area that contains messages that have been sent and are waiting to be read. Note that, contrary to what the name queue suggests, messages don't have to be delivered in the order sent. If the message driven bean pool contains more than one instance then messages can be processed concurrently and thus it is possible that a later message is processed sooner than an earlier one. A JMS queue guarantees only that each message is processed only once. JMS topic A distribution mechanism for publishing messages that are delivered to multiple subscribers. Allikas: © Ericsson Eesti AS 2010 | Public | Kristjan Kuhi |

10 JMS API(1/2) ConnectionFactory interface An administered object that a client uses to create a connection to the JMS provider. JMS clients access the connection factory through portable interfaces so the code does not need to be changed if the underlying implementation changes. Administrators configure the connection factory in the Java Naming and Directory Interface (JNDI) namespace so that JMS clients can look them up. In JMS version 1.0, depending on the type of message, users will use either a queue connection factory or topic connection factory. In version 1.1 these factories are merged into a single factory. Connection interface Once a connection factory is obtained, a connection to a JMS provider can be created. A connection represents a communication link between the application and the messaging server. Depending on the connection type, connections allow users to create sessions for sending and receiving messages from a [queue] or topic. Destination interface An administered object that encapsulates the identity of a message destination, which is where messages are delivered and consumed. It is either a queue or a topic. The JMS administrator creates these objects, and users discover them using JNDI. Like the connection factory, the administrator can create two types of destinations: queues for Point-to-Point and topics for Publish/Subscribe. Allikas: © Ericsson Eesti AS 2010 | Public | Kristjan Kuhi |

11 JMS API (2/2) MessageConsumer interface An object created by a session. It receives messages sent to a destination. The consumer can receive messages synchronously (blocking) or asynchronously (non-blocking) for both queue and topic-type messaging. MessageProducer interface An object created by a session that sends messages to a destination. The user can create a sender to a specific destination or create a generic sender that specifies the destination at the time the message is sent. Message interface An object that is sent between consumers and producers; that is, from one application to another. A message has three main parts: A message header (required): Contains operational settings to identify and route messages. A set of message properties (optional): Contains additional properties to support compatibility with other providers or users. It can be used to create custom fields or filters (selectors). A message body (optional): Allows users to create five types of messages (text message, map message, bytes message, stream message, and object message). The message interface is extremely flexible and provides numerous ways to customize the contents of a message.. Session interface Represents a single-threaded context for sending and receiving messages. A session is single-threaded so that messages are serialized, meaning that messages are received one-by-one in the order sent. The benefit of a session is that it supports transactions. If the user selects transaction support, the session context holds a group of messages until the transaction is committed, then delivers the messages. Before committing the transaction, the user can cancel the messages using a rollback operation. A session allows users to create message producers to send messages, and message consumers to receive messages. Allikas: © Ericsson Eesti AS 2010 | Public | Kristjan Kuhi |

12 SOAP over JMS http://www.w3.org/TR/soapjms/
© Ericsson Eesti AS 2010 | Public | Kristjan Kuhi |

13 Testimiseks Hermes JMS http://www.hermesjms.com/
© Ericsson Eesti AS 2010 | Public | Kristjan Kuhi |

14


Download ppt "Harjutus 3: Aünkroonne hajussüsteemi päring"

Similar presentations


Ads by Google