SendEventCustomBody - usil/eventhos-web GitHub Wiki

Send an event from a producer to a consumer system with a custom body

Video

In this video it will be shown how to conduce this use case.

📹 video

Parts

These objects body, query params, headers, oauth2-response are merged in one to be easy to query them using jsonpath

{
  "body" : {....},
  "query" : {....},
  "headers" : {....},
  "oauthResponse" : {
    "body" : {....},
    "headers" : {....}
  }
}

Forward original body

{}

Forward new body

source request

{
    "firstName": "John",
    "lastName": "doe",
    "age": 26,
    "address": {
        "streetAddress": "naist street",
        "city": "Nara",
        "postalCode": "630-0192"
    },
    "phoneNumbers": [
        {
            "type": "iPhone",
            "number": "0123-4567-8888"
        },
        {
            "type": "home",
            "number": "0123-4567-8910"
        }
    ]
}

transformed request

{
  "primerNombre" : "${.body.firstName}",
  "foo" :  "bar"
}

Oauth2 Client Security

image

  • clientid/clientsecret are sent as json
  • oauthResponse.body oauthResponse.headers will contain the data ready to be used with jsonpath

Manual

Description

Send an event from a producer system to a consumer system with custom body.

Pre requisitos

- Have administrative access.

Steps

  1. Login

image

  1. Create Aplication Resource

Create Source steps 1 Create  Source steps 2

  1. Create Rol

Create Rol 1

Select the App resource creado anteriormente y dar check al check button *.

Create Rol 2

  1. Create client and save credentials

Create Client 1 Create Client 2 Create Client 3

  1. Create producer system

Create Producer System

  1. Create consumer system

Create Consumer System 7. Create Event

Create Event

  1. Create Action

First parth
image

Second parth.

This is a example of custom body, should be write with json path.

image

  1. Create Contract
- The input **Mail recipients on error** is optional. They are the mails that received an email when an error appears.

Creare Contract Custom Body

  1. Use tool to run the event and its associated contracts
- Send a **event-identifier** and **access-key**.
- Send in the body the parameters expected and written in the action.
- Should be return a successful message.
- Should be execute endpoint saved in actions to consumer system.

Send a event-identifier and access-key.
image

Send the parameters in the body.
image

In the consumer system, I should receive the parameters sent.
image

⚠️ **GitHub.com Fallback** ⚠️