42
OMG Event Service Distributed Object Systems and Technology COMP4111

OMG Event Service

  • Upload
    pakuna

  • View
    21

  • Download
    0

Embed Size (px)

DESCRIPTION

OMG Event Service. Distributed Object Systems and Technology COMP4111. Presenters. Dean Adamson Håvard Frøiland Simon Pett. Introduction. Monitoring Problems with Client/Server Client either blocks or polls the server Increase overhead from the server Polling creates increased traffic - PowerPoint PPT Presentation

Citation preview

Page 1: OMG Event Service

OMG Event Service

Distributed Object Systems and Technology COMP4111

Page 2: OMG Event Service

Presenters

Dean Adamson Håvard Frøiland Simon Pett

Page 3: OMG Event Service

Introduction

Monitoring Problems with Client/Server– Client either blocks or polls the server– Increase overhead from the server– Polling creates increased traffic– Client and Server tightly Coupled– Reduces Scalability

Page 4: OMG Event Service

What is the Event Service?

It is a service which:– Decouples Clients from Servers by the use of a

Event Channel– Clients are regard as Consumers and Servers as

Suppliers

It provides:– Suppliers a means of sending messages to one or

more consumers with a single call without needing a reference to the consumer. It does this by sending a message through the Event Channel

Page 5: OMG Event Service

Event Channel

Supplier produce events Consumers receives events The Event Channel conveys events from the

supplier to the consumer. Thus the Supplier doesn’t need to know anything about the Consumer

Suppliers and Consumers must register to the Event Channel to send or receive events

Page 6: OMG Event Service

Different Event Service Models

There are four different Event Service Models– Canonical Push– Canonical Pull– Hybrid Push/Pull– Hybrid Pull/Push

Page 7: OMG Event Service

Canonical Push

ConsumerConsumer

SupplierSupplier

Event ChannelEvent ChannelConsumerConsumer

ConsumerConsumer

SupplierSupplierpush

push

push

push

push

• Supplier pushes events to the event channel• Event Channel then Pushes the Event to the consumer• The Supplier is the active initiator and the consumer is the passive receiver• The Event channel plays the role of the notifier

Direction of Event

Page 8: OMG Event Service

Canonical Pull Model

• The Consumer pulls events from the Event channel• The Event Channel then pulls the events from the Supplier• Consumers are the active initiators• Suppliers are the passive senders• The Event Channel plays the role of the procurer

ConsumerConsumer

SupplierSupplier

Event ChannelEvent ChannelConsumerConsumer

ConsumerConsumer

SupplierSupplierpull

pull

pull

pull

pull

Direction of Event

Page 9: OMG Event Service

Hybrid Push/Pull

• The Supplier pushes the events to the Event Channel• Consumers pull the events from the Event Channel• Both Suppliers and Consumers are active • The Event Channel acts as a queue

ConsumerConsumer

SupplierSupplier

Event ChannelEvent ChannelConsumerConsumer

ConsumerConsumer

SupplierSupplierpush

push

pull

pull

pull

Direction of Event

Page 10: OMG Event Service

Hybrid Pull/Push

• The Event Channel pulls events from the Supplier • The Event Channel then pushes the event to the Consumer• Both the Supplier and the Consumer are passive• The Event Channel acts as the event controller, i.e. controls the movement of the events

ConsumerConsumer

SupplierSupplier

Event ChannelEvent ChannelConsumerConsumer

ConsumerConsumer

SupplierSupplierpull

pull

push

push

push

Direction of Event

Page 11: OMG Event Service

Mixing Event Models

• The four model can be mixed in any combination• An Event Channel can support all four models simultaneously i.e. Each Supplier Consumer pair may chose different model through the one Event Channel• Consumers and Supplier are decoupled because none of them need to know whether the other is pushing or pulling

ConsumerConsumer

SupplierSupplier

Event ChannelEvent ChannelConsumerConsumer

ConsumerConsumer

SupplierSupplierpush

pull

push

pull

push

Direction of Event

Page 12: OMG Event Service

Event Service Interface

The event channel Push model interface Pull model interface

Page 13: OMG Event Service

The Event Channel

The event channel presents itself as a consumer to suppliers and as a supplier to consumers

Proxy interface Decoupled communications

Page 14: OMG Event Service

Interfaces for the Push Model (1)

How to push data?module CosEventComm{

exception Disconnected{};interface PushConsumer{

void push(in any data)

raises(Disconnected);void

disconnedct_push_consumer(); }; interface PushSupplier{

void disconnect_push_supplier();};//...

};

Page 15: OMG Event Service

Interfaces for the Push Model (2)

Supplier and consumer can disconnect from an event channel

module CosEventComm{exception Disconnected{};interface PushConsumer{

void push(in any data)

raises(Disconnected);void

disconnedct_push_consumer(); }; interface PushSupplier{

void disconnect_push_supplier();};//...

};

Page 16: OMG Event Service

Interfaces for the Push Model (3)

Exception if supplier push on a disconnected consumer

module CosEventComm{exception Disconnected{};interface PushConsumer{

void push(in any data)

raises(Disconnected);void

disconnedct_push_consumer(); }; interface PushSupplier{

void disconnect_push_supplier();};//...

};

Page 17: OMG Event Service

Sending data

Data is sent in form of an any Consumer either knows what type to expect in

the any or check it dynamically using the DynAny interface

Page 18: OMG Event Service

Interfaces for the Pull Model (1)

Pull() will block until the supplier wants to deliver something

module CosEventComm{interface PullSupplier{

any pull() raises(Disconnected);

any try_pull(out boolean has_event) raises(Disconnected);void

disconnect_pull_supplier();};interface PushConsumer{

void disconnect_pull_consumer();};//...

};

Page 19: OMG Event Service

Interfaces for the Pull Model (2)

We can instead of the blocking method pull use try_pull

module CosEventComm{interface PullSupplier{

any pull() raises(Disconnected);

any try_pull(out boolean has_event) raises(Disconnected);void

disconnect_pull_supplier();};interface PushConsumer{

void disconnect_pull_consumer();};//...

};

Page 20: OMG Event Service

Interfaces for the Pull Model (3)

Exceptions

Disconnect

This is similar to the push model

module CosEventComm{interface PullSupplier{

any pull() raises(Disconnected);

any try_pull(out boolean has_event) raises(Disconnected);void

disconnect_pull_supplier();};interface PushConsumer{

void disconnect_pull_consumer();};//...

};

Page 21: OMG Event Service

The Event Channel Interface

1. Implement a servant for your push consumer or pull supplier. Both push suppliers and pull consumers are clients, so you do not need to implement servants for those cases.

2. Obtain a reference to the event channel.

Page 22: OMG Event Service

The Event Channel Interface

3. Get a ConsumerAdmin reference from the EventChannel if you want to register a consumer, or get a SupplierAdmin reference if you want to register a supplier.

Page 23: OMG Event Service

The Event Channel Interface

4. Obtain the proxy object reference. The type of proxy object will depend on what event model you want to use.

5. Invoke the appropriate connection operation on the proxy object.

Page 24: OMG Event Service

Interfaces for the Event Channel (1)

(3) Get a ConsumerAdmin or a SupplierAdmin reference from the event channel

interface EventChannel{ConsumerAdmin for_consumers();SupplierAdmin for_suppliers();void destroy();

};

Page 25: OMG Event Service

Interfaces for the Event Channel (2)

(4) When we have a “Admin” reference we can obtain the “proxy type” we want

interface SupplierAdmin{ProxyPushConsumer obtain_push_consumer();ProxyPullConsumer obtain_pull_consumer();

}; interface ConsumerAdmin{

ProxyPushSupplier obtain_push_supplier();ProxyPullSupplier obtain_pull_supplier();

};

Page 26: OMG Event Service

Interfaces for the Event Channel (3)

An event channel can act as

(5) So we invoke the appropriate interface according to our model

module CosEventChannelAdmin{interface ProxyPushSupplier;interface ProxyPullSupplier;interface ProxyPushConsumer;interface ProxyPullConsumer;

//…};

Page 27: OMG Event Service

Forging ahead

Choosing an Event Channel Model Event Channel Federation Limitations Code practices and Alternative CORBA

Services Summary and Wind up.

Page 28: OMG Event Service

Choosing An Event Model

Characterisitcs of each model Your system Event Channel implementation

– OMG does not define many of the key characteristics so shop around for the best Channel

– Throughput is dependant on the Channel efficiecy– ORBs marshaling and unmarshaling of the any type

Page 29: OMG Event Service

Consumer and Supplier Numbers

Buffering and Queueing efficiencies Not just network connections

Page 30: OMG Event Service

Event Channel Federation

Event channels support the consumer and supplier interfaces for Push and Pull Models

Supplier EventChannel

Supplier

Supplier

Consumer

Consumer EventChannel

push

push

push

pull

Consumer

Consumer

Consumer

Consumer

push

pushpull

pull

Page 31: OMG Event Service

Is the Event Service everyone’s cup of tea ?

Everything in life is a trade off Multiple Suppliers Lack of Filtering Lack of Reliability Portability Asynchronous Messaging

Page 32: OMG Event Service

Multiple Suppliers

Consumers receive all events Client can filter via extraction using any Type

– This can be a waste of resources

Multiple Event Channels per Type– Also a waste of resources and defeats aims of

Event Service

Limit suppliers per Event Channel– unreasonable request on developers

Page 33: OMG Event Service

Filtering

In fact problem exists even if Event Channel has one supplier

Event service should be able to filter the Events Allows designer to make tradeoff as to where

resources are used– Client, Network– Event Service

Notification Service

Page 34: OMG Event Service

Reliability

Event flooding Difficult to guarantee end-to-end delivery of

service without a throttle on suppliers A client has no guarantee of receiving events

Page 35: OMG Event Service

Portability

The spec has problems Factory template method for channel creation Queue limits Timeout limits Consumer Supplier registration

Page 36: OMG Event Service

Asynchronous Communications

Is NOT provided by the Event Service It only decouples Callback or heartbeat poll needed Messaging Service

– Time independent– Throttle

Page 37: OMG Event Service

What have we learnt ?

Synchronous requests can be too restrictive Event Service simply handles event delivery Acts as a Mediator Decoupling suppliers from

consumers Based upon concept of Event Channels

Page 38: OMG Event Service

Event Channel Summary

Channel has two models of delivery:– Push– Pull

Combinations of which form:– Hybrid– Mixed

Page 39: OMG Event Service

How does it work ?

Implement a servant if using a push Consumer or pull Supplier

Obtain a reference from an event channel Get ConsumerAdmin or SupplierAdmin to

register Obtain proxy object to reference model Invoke the appropriate connection operation

Page 40: OMG Event Service

There are Drawbacks to Consider

No filtering No specification as to persistent storage of

Registration Queue and timeout limits A real time event-based system is difficult

Page 41: OMG Event Service

4th Assignment

There is a ORBacus demo Setting up the basics is simple Choosing the right model will require some

thought

Page 42: OMG Event Service

Bibliography

Michi Henning & Steve Vinoski (1999). Advanced CORBA Programming with C++. Addison-Wesly

ORBacus (2000). ORBacus for C++ and Java Ian Gorton (2000). Entiprise Transaction

Processing Systems. Addison-Wesly