Giter Club home page Giter Club logo

eventing-publisher-proxy's Introduction

Eventing Publisher Proxy

Overview

The Eventing Publisher Proxy receives legacy and Cloud Event publishing requests from the cluster workloads (microservice or Serverless functions) and redirects them to the Enterprise Messaging Service Cloud Event Gateway. It also fetches a list of subscriptions for a connected application.

Prerequisites

Development

Build

make build

Run Tests

Run the unit and integration tests:

make generate-and-test

To run the E2E tests, refer to Testing.

Linting

  1. Fix common lint issues:

    make imports
    make fmt
    make lint-fix

Build Container Images

Build and push your image to the location specified by IMG:

make docker-build docker-push IMG=<container-registry>/eventing-publisher-proxy:<tag> # If using docker, <container-registry> is your username.

For MacBook M1 devices, run:

make docker-buildx IMG=<container-registry>/eventing-publisher-proxy:<tag>

Deployment

You need a Kubernetes cluster to run against. You can use k3d to get a local cluster for testing, or run against a remote cluster.

Deploy Inside a Cluster

$ ko apply -f config/event-publisher-proxy/

Usage

Send Events

The following command supports CloudEvents:

curl -v -X POST \
    -H "Content-Type: application/cloudevents+json" \
    --data @<(<<EOF
    {
        "specversion": "1.0",
        "source": "/default/sap.kyma/kt1",
        "type": "sap.kyma.FreightOrder.Arrived.v1",
        "eventtypeversion": "v1",
        "id": "A234-1234-1234",
        "data" : "{\"foo\":\"bar\"}",
        "datacontenttype":"application/json"
    }
EOF
    ) \
    http://<hostname>/publish

This command supports legacy events:

curl -v -X POST \
    -H "Content-Type: application/json" \
    --data @<(<<EOF
    {
        "event-type": "order.created",
        "event-type-version": "v0",
        "event-time": "2020-04-02T21:37:00Z",
        "data" : "{\"foo\":\"legacy-mode-on\"}"
    }
EOF
    ) \
    http://<hostname>/application-name/v1/events

Get a list of subscriptions for a connected application

curl -v -X GET \
    -H "Content-Type: application/json" \
    http://hostname/:application-name/v1/events/subscribed

Environment Variables

Environment Variable Default Value Description
INGRESS_PORT 8080 The ingress port for the CloudEvents Gateway Proxy.
MAX_IDLE_CONNS 100 The maximum number of idle (keep-alive) connections across all hosts. Zero means no limit.
MAX_IDLE_CONNS_PER_HOST 2 The maximum idle (keep-alive) connections to keep per-host. Zero means the default value.
REQUEST_TIMEOUT 5s The timeout for the outgoing requests to the Messaging server.
CLIENT_ID The Client ID used to acquire Access Tokens from the Authentication server.
CLIENT_SECRET The Client Secret used to acquire Access Tokens from the Authentication server.
TOKEN_ENDPOINT The Authentication Server Endpoint to provide Access Tokens.
EMS_PUBLISH_URL The Messaging Server Endpoint that accepts publishing CloudEvents to it.
BEB_NAMESPACE The name of the namespace in BEB.
EVENT_TYPE_PREFIX The prefix of the eventType as per the BEB event specification.

Flags

Flag Default Value Description
max-request-size 65536 The maximum size of the request.
metrics-addr :9090 The address the metric endpoint binds to.

eventing-publisher-proxy's People

Contributors

dependabot[bot] avatar friedrichwilken avatar marcobebway avatar mfaizanse avatar k15r avatar grischperl avatar sayanh avatar the1bit avatar vpaskar avatar raypinto avatar muralov avatar nachtmaar avatar ressetkk avatar pxsalehi avatar a-thaler avatar themue avatar jeremyharisch avatar nhingerl avatar halamix2 avatar dekiel avatar thandayuthapani avatar

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.