1 / 20

EP 124 Use of a New Message Service in Enterprise Application Server

EP 124 Use of a New Message Service in Enterprise Application Server. Volker Saggau Sybase Germany Systems Consultant Saggau@Sybase.com. Do you need to notify clients ? Even several thousand ? Do you need asynchronous communication ? Do you have to create work flows ?

aaralyn
Download Presentation

EP 124 Use of a New Message Service in Enterprise Application Server

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EP 124Use of a New Message Service in Enterprise Application Server • Volker Saggau • Sybase Germany • Systems Consultant • Saggau@Sybase.com

  2. Do you need to notify clients ? Even several thousand ? Do you need asynchronous communication ? Do you have to create work flows ? Do you need asynchronous intercomponent communication for realtime data feeds or other external systems? Introduction 1

  3. If the answers is YES to one of these questions your are right here! Introduction 2

  4. Needs for MessageService Terms used Basic API Samples Agenda

  5. Corba is synchronous Long lasting function calls will block users and resources User want to be informed “life” Stock quotes from Reuters, Datastream, CEF Realtime auctions Information distribution/concentration one to many many to one n to m Need for MessageService 1

  6. Sample from the real world Use for a foreign exchange system See separate presentation here from the owner Reuters,many notified users Session No. IA 339 Using for interfacing data feeds CTH in Germany are using several datastreams for a unified data feed system. Interface for users is a message queue. Need for MessageService 2

  7. As JMS (Java Messaging Service) is part of J2EE, Sybase wants to offer a solution here. The MessageService will come with JMS interface in EAS 3.6 Combination with SEEB Combination with Message Broker Need for MessageService 3

  8. Needs for MessageService Terms used Basic API Samples Agenda

  9. Message Information to send to MessageService can have a string and/or property list Topic Used for publish/send to identify the area of interest of a message. Sample “Stock.SYBS” means : This message has information on Sybase stocks Terms 1

  10. publish/send/receive Messages can be published or send from the information giving side Messages can be received from the information wanting side Queue The receiver information is coming over a queue A queue is typical a subset of all available messages Selector A selector discribes how the subset of messages is defined Terms 2

  11. Needs for MessageService Terms used Basic API Samples Agenda

  12. void publish ( in string topic, in CtsComponents::Message msg, in long options ); API 1 CTSComponents::MessageService

  13. public void notifyStockValue(MessageService cms, String stock, double value) { String topic = "StockValue." + stock; String time = new java.util.Date().toString(); String text = time + ": The stock " + stock + " has value " + value; Message msg = new Message(); msg.key = cms.getMessageKey(); msg.props = new Property[2]; msg.props[0] = new Property("stock", new PropertyValue()); msg.props[0].value.stringValue(stock); msg.props[1] = new Property("value", new PropertyValue()); msg.props[1].value.doubleValue(value); msg.replyTo = ""; msg.text = text; cms.publish(topic, msg, 0); } API 2 CTSComponents::MessageService

  14. void send ( in string queue, in CtsComponents::Message msg, in long options ); API 3 CTSComponents::MessageService

  15. public void notifyOrder(MessageService cms, String queue, int orderNo, String product) { String time = new java.util.Date().toString(); String text = "Order " + orderNo + " for product ” + product + " was completed at " + time; Message msg = new Message(); msg.key = cms.getMessageKey(); msg.props = new Property[2]; msg.props[0] = new Property("orderNo",new PropertyValue()); msg.props[0].value.longValue(orderNo); msg.props[1] = new Property("product", new PropertyValue()); msg.props[1].value.stringValue(product); msg.replyTo = ""; msg.text = text; cms.send(queue, msg, PERSISTENT.value); } API 4 CTSComponents::MessageService

  16. receive ( in long maximum, in long timeout ) maximum Maximum number of messages to get from the queue. If set to zero or a negative number, all messages are retrieved. timeout Number of seconds to wait for new messages to arrive in the queue. If set to zero or a negative number, return immediately. API 5CTSComponents:MessageQueue

  17. This code gets all the messages from the queue and waits five minutes for new messages to arrive: Message[] seq = mq.receive(0, 300); API 6CTSComponents:MessageQueue

  18. Needs for MessageService Terms used Basic API Samples Agenda

  19. Server: (show Java code) Sample 1

  20. Client: (show Java code) Sample 2

More Related