mirror of https://github.com/dapr/docs.git
Changed port number in the command
Signed-off-by: Amulya Varote <amulyavarote@MININT-8V4CL0S.redmond.corp.microsoft.com>
This commit is contained in:
parent
22cc6477a9
commit
45c59b4d5b
|
|
@ -373,7 +373,7 @@ To publish a topic you need to run an instance of a Dapr sidecar to use the pubs
|
||||||
Start an instance of Dapr with an app-id called `orderprocessing`:
|
Start an instance of Dapr with an app-id called `orderprocessing`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dapr run --app-id orderprocessing --dapr-http-port 3500
|
dapr run --app-id orderprocessing --dapr-http-port 3601
|
||||||
```
|
```
|
||||||
{{< tabs "Dapr CLI" "HTTP API (Bash)" "HTTP API (PowerShell)">}}
|
{{< tabs "Dapr CLI" "HTTP API (Bash)" "HTTP API (PowerShell)">}}
|
||||||
|
|
||||||
|
|
@ -555,7 +555,7 @@ func main() {
|
||||||
}
|
}
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
//Using Dapr SDK to publish to a topic
|
|
||||||
if err := client.PublishEvent(ctx, PUBSUB_NAME, TOPIC_NAME, []byte(strconv.Itoa(orderId)));
|
if err := client.PublishEvent(ctx, PUBSUB_NAME, TOPIC_NAME, []byte(strconv.Itoa(orderId)));
|
||||||
err != nil {
|
err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
@ -583,7 +583,7 @@ import { DaprServer, DaprClient, CommunicationProtocolEnum } from 'dapr-client';
|
||||||
const daprHost = "127.0.0.1";
|
const daprHost = "127.0.0.1";
|
||||||
|
|
||||||
var main = function() {
|
var main = function() {
|
||||||
var orderId = Math.floor(Math.random() * (1000 - 1) + 1);
|
var orderId = 100;
|
||||||
start(orderId).catch((e) => {
|
start(orderId).catch((e) => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|
@ -593,7 +593,6 @@ var main = function() {
|
||||||
async function start(orderId) {
|
async function start(orderId) {
|
||||||
const client = new DaprClient(daprHost, process.env.DAPR_HTTP_PORT, CommunicationProtocolEnum.HTTP);
|
const client = new DaprClient(daprHost, process.env.DAPR_HTTP_PORT, CommunicationProtocolEnum.HTTP);
|
||||||
console.log("Published data:" + orderId)
|
console.log("Published data:" + orderId)
|
||||||
//Using Dapr SDK to publish to a topic
|
|
||||||
await client.pubsub.publish("order_pub_sub", "orders", orderId);
|
await client.pubsub.publish("order_pub_sub", "orders", orderId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue