Git Product home page Git Product logo

Comments (2)

qmacro avatar qmacro commented on June 7, 2024

The Emitter is indicated by the "Emitter (Shell script") block in the schematic diagram.

It can be found in the s4hana/event/ directory of this repository.

Overview

The Emitter represents the kick-off of the whole flow, by emitting an event message to the "salesorder/created" topic on the instance of the Enterprise Messaging service.

It is a single Bash shell script emit, supported by two helper libraries:

  • localutils providing basic functions for logging, access token retrieval, and so on
  • settings providing the actual names of instances, plans and service keys

The Emitter uses the Messaging API to publish a message to a topic on the bus provided by this project's Enterprise Messaging service instance. The specific API endpoint used is POST /messagingrest/v1/topics/{topic-name}/messages.

The API call is authenticated with OAuth 2.0, whereby an access token is retrieved using details in the emdev service instance's service key sk1 - the specifics which are from the settings helper library.

Usage

The Emitter (the emit script) is designed to be used from the command line, and expects a single parameter that is mandatory - the sales order number. This must be a sales order that exists in the Sandbox (S/4HANA mock system). See the A_SalesOrder entityset data to look for valid sales order numbers.

To use this Emitter:

  1. Clone this repository locally
  2. Move into the s4hana/event/ directory
  3. Log into CF and connect to the 9e079cc4trial/dev org/space
  4. Choose a sales order number (e.g. 1)
  5. Call the Emitter: ./emit <salesordernumber> (e.g. ./emit 1)

This should result in a couple of log messages like this:

2020-10-07 12:50:56 Publishing sales order created event for 1
2020-10-07 12:50:56 Publish message to topic salesorder%2Fcreated

The %2F in the topic name is a URL encoded / which is required because the Messaging API endpoint uses the topic name in the URL path (!)

from teched2020-developer-keynote.

qmacro avatar qmacro commented on June 7, 2024

I've added the above content to a new README.md in the s4hana/event/ directory.

from teched2020-developer-keynote.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.