azure-event-hubs-test-client
所属分类:中间件编程
开发工具:JavaScript
文件大小:0KB
下载次数:0
上传日期:2022-11-02 18:46:35
上 传 者:
sh-1993
说明: 使用Kafka协议将测试消息发送到Azure事件中心
(Send test message to Azure Event Hub using Kafka protocol)
文件列表:
.dockerignore (121, 2022-11-02)
Dockerfile (542, 2022-11-02)
LICENSE (1068, 2022-11-02)
app/ (0, 2022-11-02)
app/app.js (2041, 2022-11-02)
app/config.js (271, 2022-11-02)
app/events/ (0, 2022-11-02)
app/events/event-base.js (1340, 2022-11-02)
app/events/event-receiver.js (996, 2022-11-02)
app/events/event-sender.js (1162, 2022-11-02)
app/events/index.js (149, 2022-11-02)
app/favicon.ico (170227, 2022-11-02)
app/format-event/ (0, 2022-11-02)
app/format-event/index.js (462, 2022-11-02)
app/index.js (245, 2022-11-02)
app/map-total/ (0, 2022-11-02)
app/map-total/index.js (151, 2022-11-02)
app/validation/ (0, 2022-11-02)
app/validation/index.js (713, 2022-11-02)
app/views/ (0, 2022-11-02)
app/views/index.njk (4739, 2022-11-02)
app/views/layout.njk (797, 2022-11-02)
azure-pipelines.yaml (380, 2022-11-02)
docker-compose.override.yaml (353, 2022-11-02)
docker-compose.yaml (159, 2022-11-02)
docs/ (0, 2022-11-02)
docs/screenshot.png (65662, 2022-11-02)
helm/ (0, 2022-11-02)
helm/azure-event-hubs-test-client/ (0, 2022-11-02)
helm/azure-event-hubs-test-client/.helmignore (373, 2022-11-02)
helm/azure-event-hubs-test-client/Chart.yaml (218, 2022-11-02)
helm/azure-event-hubs-test-client/templates/ (0, 2022-11-02)
helm/azure-event-hubs-test-client/templates/_container.yaml (204, 2022-11-02)
helm/azure-event-hubs-test-client/templates/cluster-ip-service.yaml (327, 2022-11-02)
helm/azure-event-hubs-test-client/templates/configmap.yaml (252, 2022-11-02)
helm/azure-event-hubs-test-client/templates/deployment.yaml (305, 2022-11-02)
helm/azure-event-hubs-test-client/templates/ingress.yaml (153, 2022-11-02)
helm/azure-event-hubs-test-client/values.yaml (276, 2022-11-02)
... ...
[![Build Status](https://dev.azure.com/johnwatson484/John%20D%20Watson/_apis/build/status/Azure%20Event%20Hubs%20Test%20Client?branchName=master)](https://dev.azure.com/johnwatson484/John%20D%20Watson/_build/latest?definitionId=43&branchName=master)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=johnwatson484_azure-event-hubs-test-client&metric=alert_status)](https://sonarcloud.io/dashboard?id=johnwatson484_azure-event-hubs-test-client)
[![Known Vulnerabilities](https://snyk.io/test/github/johnwatson484/azure-event-hubs-test-client/badge.svg)](https://snyk.io/test/github/johnwatson484/azure-event-hubs-test-client)
# Azure Event Hubs Test Client
A test client for sending JSON format events to Azure Event Hubs or Kafka broker.
## Prerequisites
Node v18+
Or:
Docker
## Running the client
### From source
- Clone the repo and run `npm install` to install required npm packages
- Update the preferred port in the `config.js` file. By default this is set to **3012**.
### Node
- Run `npm start` to start the application.
### Docker Compose
- Run `docker-compose build`
- Run `docker-compose up`
### Docker
`docker run -p 3012:3012 johnwatson484/azure-event-hubs-test-client`
### Hosted
A hosted version is available at https://aehtc.lynxmagnus.com/
## Using the client
The below screenshot shows an overview of the the client.
![Client Screenshot](/docs/screenshot.png "Client Screenshot")
### Set the host
If using Azure Event Hubs then set this value to your Azure Event Hubs namespace. For example, `myeventhub.servicebus.windows.net`
If using Kafka then set this to the hostname of the broker. If running the client in a container and the broker is accessible on the host device's localhost. Then set this value to `host.docker.internal`.
### Set the port
If using Azure Event Hubs this value is ignored. If using Kafka then set the port of the broker.
### Set authentication
The client supports three methods for authentication.
- Connection String, for Azure Event Hubs authentication
- Username and password, for Kafka clients with plain authentication
- None, for Kafka clients with no authentication
#### Connection string format
This can be found in the Azure portal under Shared Access Policies for either the root account or a specific queue key.
This must be in the below format and note that the validation provided by the client is case sensitive. For example "endpoint=..." would be invalid. EntityPath is optional as it only applies to queue policies.
`Endpoint=sb://YOUR_HOSTNAME/;SharedAccessKeyName=KEYNAME;SharedAccessKey=KEY;`
### Set the Event Hub name
This is the Event Hub where the event will be sent to.
### Set the event type (optional)
This value will be added to the message body as a `type` property.
### Set the routing key (optional)
This value will be added to the header metadata as a `routingKey` property
### Set the event value
This is the value that will be sent to the Event Hub and must be in JSON format.
Any `##` placeholders will be replaced by an auto incrementing integer.
### Set the total
The number of copies of the event to send.
## Errors
If invalid credentials or malformed JSON is provided an error will be returned through the client.
近期下载者:
相关文件:
收藏者: