diff --git a/README.md b/README.md index 2be08b3..36602d7 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Direct integration with SAP S/4HANA Business Event Handling allows efficient dev This repository provides documentation and samples of how to use the Messaging Client (Node.js) for messaging via SAP Cloud Platform Enterprise Messaging in the Cloud Foundry environment. Details on each sample application and the covered scenario are described in the table _List of content and sample projects_ below. -For more details of **SAP Cloud Platform Enterprise Messaging** take a look at the [Enterprise Messaging - Messaging Clients landing page](https://github.com/pages/SAP/enterprise-messaging-samples/) and [SAP Cloud Platform Enterprise Messaging on SAP Help portal](https://help.sap.com/viewer/product/SAP_ENTERPRISE_MESSAGING/Cloud/en-US). +For more details of SAP Cloud Platform Enterprise Messaging take a look at the [SAP Cloud Platform Enterprise Messaging on SAP Help portal](https://help.sap.com/viewer/product/SAP_ENTERPRISE_MESSAGING/Cloud/en-US). This repository provides samples of how to use the Messaging Client (Node.js) for messaging via SAP Cloud Platform Enterprise Messaging in the Cloud Foundry environment. @@ -14,7 +14,7 @@ This repository provides samples of how to use the Messaging Client (Node.js) fo |Sample/Content|Scenario|Scenario Description| |---|---|---| -|[xb-msg-amqp-v100-doc](xb-msg-amqp-v100-doc)|Node.js Messaging Client documentation (includes basic sample)|Documentation and related samples which shows hot this library provides a messaging client as well as classes to realize a server for `AMQP 1.0`| +|[xb-msg-amqp-v100-doc](xb-msg-amqp-v100-doc)|Node.js Messaging Client documentation (includes basic sample)|Documentation and related samples which shows how this library provides a messaging client as well as classes to realize a server for `AMQP 1.0`| |[xb-msg-amqp-v100-samples](xb-msg-amqp-v100-samples)|Basic Messaging Sample which runs locally|This sample demonstrates how each application (plain Node.js, non SAP CP) can use the _Enterprise Messaging Client_ to send and receive messages via _SAP Cloud Platform Enterprise Messaging_. Therefore the messaging sample consists of a `consumer.js` and a `producer.js` which provides the corresponding functionality for send/receive (and the `config/cf-sample-config.js` to configure the sample)| |[event-simulator](event-simulator)|Event Simulator for SAP CP deployment|The Event Simulator application demonstrates a scenario where events are emitted and send as messages via Enterprise Messaging which were consumed and further processed (i.e. logged via console). Therefore the messaging sample consists of a `main.js` which provides the corresponding functionality and start the simulation (and a `config.js` to configure the sample)| diff --git a/xb-msg-amqp-v100-samples/README.md b/xb-msg-amqp-v100-samples/README.md index 4793865..d865c87 100644 --- a/xb-msg-amqp-v100-samples/README.md +++ b/xb-msg-amqp-v100-samples/README.md @@ -7,10 +7,12 @@ Sample application (plain Node.js) of how to use the _Enterprise Messaging Clien This section includes the _Prerequisite_, describe _how to install_ and _how to configure_ this basic sample. 1. Prerequisite: Enable Enterprise Messaging on _SAP CP_ - 1. Create required _Enterprise Messaging_ service via e.g. `cf cs enterprise-messaging dev enterprise-messaging-service-instance-name -c '{"emname":"sample_application"}'` - 1. Create service key via e.g. `cf csk enterprise-messaging-service-instance-name key-name -c '{"emname":"sample_application"}'` + 1. Create required _Enterprise Messaging_ service via e.g. `cf cs enterprise-messaging default enterprise-messaging-service-instance-name -c config/descriptor.json'` + 1. Create service key via e.g. `cf csk enterprise-messaging-service-instance-name key-name -c config/descriptor.json'` 1. Get key via e.g. `cf service-key enterprise-messaging-service-instance-name key-name` 1. Update the `config/cf-sample-config.js` with information of the _service key_ + 1. More info regarding enterprise messaging serviceinstance creation is available [here](https://help.sap.com/viewer/bf82e6b26456494cbdd197057c09979f/Cloud/en-US/d0483a9e38434f23a4579d6fcc72654b.html) + 1. Install required dependencies via `npm install` 1. Run sample application 1. Start producer via `npm run-script producer` (default) or via `node src/producer.js ../config/cf-sample-config.js` (with given config file) diff --git a/xb-msg-amqp-v100-samples/config/descriptor.json b/xb-msg-amqp-v100-samples/config/descriptor.json new file mode 100644 index 0000000..54629f5 --- /dev/null +++ b/xb-msg-amqp-v100-samples/config/descriptor.json @@ -0,0 +1,28 @@ +{ + "emname": "myapp", + "namespace": "myorg/myapp/myid", + "version": "1.1.0", + "options": { + "management": true, + "messagingrest": true, + "messaging": true + }, + "rules": { + "queueRules": { + "publishFilter": [ + "${namespace}/*" + ], + "subscribeFilter": [ + "${namespace}/*" + ] + }, + "topicRules": { + "publishFilter": [ + "${namespace}/*" + ], + "subscribeFilter": [ + "${namespace}/*" + ] + } + } +} \ No newline at end of file