Doorgaan naar hoofdcontent

Event Driven Architecture with Oracle EDN



"The flying Dutchman" (see also photo page)



Key Takeaways
  • Event Driven Architecture helps with decoupling applications

  • Think about the names used for events
  • Let Publisher publish and filter within subscribers
  • Use meta data within event headers
  • Use standardization on entities within Event, so that the Event is a first citizen data object

Introduction

There is a lot of hype around Microservices and the use of events for implementing the choreography pattern. However this is nice for companies like Netflix and Twitter, but there are a lot of organisations still struggling with files and ESB like products. Also my current client uses an ESB namely the Oracle SOA Suite 12c for integrations. We cannot just throw away this ESB, but we can make use of the event mechanism built in. This blog describes the way we use the EDN (Event Delivery Network) component, that is used within SOA composites to throw events and to subscribe on events.

EDN

Oracle has a component that you can use to publish events and to subscribe on events within a SOA composite. Just use the invoke activity with the eventname and the content of the event. Within a composite you can subscribe on events and set filters. You can also configure “oneAndOnlyone” consistency property and indicate if you want a durable or non-durable subscriber. The EDN hides the underlying JMS provider, which can be changed (weblogic jms or OracleAQ). Separate Topics can be defined for each event or just use 1 topic for all events.
Notes:
  • Applications must always be abstracted by a corresponding SOA Composite. Applications should not use JMS directly 
  • EDN cannot be used directly from within Oracle OSB

Event

We use the following definition for an event. The event is based on business entities and the operations executed on those entities. We use the following definition:

BusinessObject    The name of the business entity, i.e. Invoice, Customer
Operation         Created, Updated, Deleted
TrackingId        Tracking ID so that flows can be followed
SourceSystem      The system that published the event
TargetSystem      The target system to which the event must be sent explicitly. This is
an optional field
Identifiers       This is used to add meta data, i.e. invoice number, location, order number
Message           The message. This contains the content of the business entity

Master data entities
This works fine for master data entities, because you want to use events to indicate that entities are created, updated or deleted. We use this to decouple the MDM solution from the interested applications. New applications are easily added by making a SOA composite subscriber for that application.

Transactional data
In this case the solution falls short, because the context is missing. For example when an Invoice is received from a customer, you want to send the event InvoiceReceivedFromCustomer. In our case we use the Created operation on Invoice but this does not say much. Within the meta data we had to add more context information.


Lessons learned
  • Think about the names you use for Events, i.e. Invoice_Create is too vague and will need more metadata to filter on the correct event
  • Think about the data you put in the message
  • Master data entities can be especially good candidates to publish

Data will change

The content of entities will change, i.e. fields are added. After this change you want to synchronize the interested applications with this new information. This is especially needed for master data. So you are decoupled on the publishing- and subscribing applications, but still strongly coupled to the data. You need to synchronize the new dataset to the applications (batch). There are several options:

·         Use ETL to synchronize the data

This can be a good option in case it is lots of data. Extra tooling and data transformation is needed, which you tried to avoid. The source and target systems are again coupled.


·         Publish all data and make use of the Pub-Sub implementation
This works fine in case there are less entities. You don’t need extra ETL tooling but re-use the publish-subscribe mechanism. We use this and also use the targetSystem field within the event, when we know it is only relevant to a particular application(s).


Lessons learned
  • Think about data reconciliation in case data fields are changed
  • Try to avoid ETL because this couples the source and target systems again


Filters

What I see often in integration projects, is that each interested application a new integration is built particularly for that application. For example a new supplier wants to retrieve Invoice messages from the company. However it wants to retrieve the invoice in its own format (for example csv) and based on its own protocol (for example sftp). The application, that generates the invoices, just exports yet another file. What I propose is to let the publishing application generate Invoice events. It should have no knowledge about the interesting applications. It just has to do the jobs. Then for each supplier make a Subscribe composite that filters the Invoices targeted for that supplier and map the Invoice to the suppliers format and protocol. This is where the Subscriber composite filters come in.


With the filter you can define which events you want to receive. Note that you can also indicate if you want to have a Durable subscriber. In that case you receive events in case the composite was stopped.


Lessons learned
  • Let Publishers publish all data and let Subscriber filter the correct data
  • Filter on the meta data part of the event and not on the event message content

Error handling

Functional- and technical errors are unavoidable. This also is the case with events, but with the extra complexity that the publisher is decoupled from the subscriber(s). This means that in case the event is published from the source, the work is done. But still errors can occur within the subscriber both functionally as technically. you have to think of the following scenario's:
  • Do i want to be able to re-publish the same event?
    The consequence is that target systems must implement idempotency
  • Does the sending application need to know that all targets have successfully handled the event?
    I my opinion you should try to solve the problem at the target, because otherwise you introduce strong coupling again. This also depends on the business requirements of course.

Conclusion

There are more topics that can be discussed, i.e. event versioning, data security. Maybe another time.
As always, feedback and questions are very welcome !


Conclusion
Event driven architectures can be a good solution to decouple applications! We are now able to connect new applications faster than before, because of the Pub-Sub pattern and the standardization of the event data.
Think about the events you publish, because otherwise you still need much of filter logic within the subscribers. Also think about the way you want so solve data synchronization/reconciliation in case the data is changed.


Reacties

  1. Deze reactie is verwijderd door een blogbeheerder.

    BeantwoordenVerwijderen
  2. Thanks for sharing this. Nice informative and helpfull.We are the largest shot blasting machine manufacturers & Suppliers in Faridabad,India. Get the all types of Shot

    blasting machines and their equipments @ best prices & unmatched services. Call us @ 9811083740.
    shot blasting machine manufacturers
    shot blasting
    sandblasting
    sand blasting machine
    steel shots distributors
    Sandblasting Abrasive media

    BeantwoordenVerwijderen

  3. Awesome post. I am a normal visitor of your blog and appreciate you taking the time to maintain the excellent site. I’ll be a frequent visitor for a long time.
    video production company
    production houses in delhi
    Corporate film makers
    Documentary Film Makers in Delhi
    Filmmakers in Delhi
    promotional video services in delhi ncr

    BeantwoordenVerwijderen
  4. Jeewangarg is one of the Best Digital Marketing Agencies where you can find each and every solution under one roof. We are efficient enough to provide our clients the best seo services in Delhi & PPC Services in Delhi at the same place. Moreover, we are the best website designing company in delhi ncr.

    BeantwoordenVerwijderen
  5. Nice post. Plan Your next Holidays with Indian Travel Store and get some Exciting Deals on Tours & Travels Packages for Shimla, Manali, Nepal, Bhutan, Rajasthan, Dalhousie, Dharamshala, Kerala, Uttarakhand and many more. Book your next Shimla Manali Tour Package with us for availing some great deals.

    Manali tour package
    Shimla manali tour package

    BeantwoordenVerwijderen
  6. Great post. Keep sharing amazing content like this

    Also checkout some interesting content from below links

    Hostinger Black Friday Deal
    Black Friday Email Marketing Tools
    Acadle Lifetime Deal

    BeantwoordenVerwijderen




  7. The GDS3702 features a built-in microphone and speaker to support intercom functionality supports integration with electric locks for locking and unlocking doors and offers alarm-in and alarm-out support for integration with existing security systems.

    BeantwoordenVerwijderen

Een reactie posten

Populaire posts van deze blog

OSB 10gR3 and SWA and MTOM

This blog is about using soap with attachments and the use of MTOM within the OSB (10gR3). A service is created that accepts a soap with attachment (DocumentService) and translates it to a service that accepts a binary element. MTOM is used for performance reasons for the second. Some notes: * For the use of attachments you need RPC-style document instead of the usual document-style. This due to the fact that the document-style limits a message to a single . * A service can not have both SWA and MTOM within OSB. First a WSDL is setup for the DocumentService: The $attachments variable holds the attachments and the body holds the attachment data. Also other data is stored within the attachment element (see h...

Microservices mindmap

"The tree" - See also   my photo page When you are fairly new within the Microservices land, there are a lot of terms fired at you. So also for my own understanding i have made a mindmap. I think it has a good status now, so that i can share it with you. As always feedback is very welcome ! You can download the mindmap here .

Book review: Data Management at Scale (Piethein Strengholt)

 This blog is a review of the book "Data Management at Scale (See also at bol.com ) Data Management is a hot topic nowadays and this book does a fantastic job at adding value to this topic. It is a must read and one of the few technical books I finished reading in a weekend. The book gives a fantastic overview on how to implement a Data Mesh data architecture. The Data Mesh concept is explained by Martin Fowler here . The book is a good mix between conceptual and implementation architecture level. It gives a lot of examples of how this architecture at scale can work, for both small and big companies. It is practical and I used it to implement it at one of my customers. The book describes an architecture in which the focus is on the DIAL (Data- and Integration Access Layer).  On a high level the book covers the following topics: The key principles for data management at scale - Domain-Driven Design  - Domain Data Stores - Meta data management Ready Data Store The concept ...