mirror of https://github.com/dapr/docs.git
Changed port number in the command
Signed-off-by: Amulya Varote <amulyavarote@Amulyas-MacBook-Pro.local>
This commit is contained in:
parent
619ac7e5ad
commit
32a1996acb
|
@ -474,10 +474,14 @@ Start an instance of Dapr with an app-id called `orderprocessing`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
dapr run --app-id orderprocessing --dapr-http-port 3601
|
dapr run --app-id orderprocessing --dapr-http-port 3601
|
||||||
=======
|
=======
|
||||||
dapr run --app-id orderprocessing --dapr-http-port 3500
|
dapr run --app-id orderprocessing --dapr-http-port 3500
|
||||||
>>>>>>> 0e83af7a (Added pub sub documentation)
|
>>>>>>> 0e83af7a (Added pub sub documentation)
|
||||||
|
=======
|
||||||
|
dapr run --app-id orderprocessing --dapr-http-port 3601
|
||||||
|
>>>>>>> 3380b73a (Changed port number in the command)
|
||||||
```
|
```
|
||||||
{{< tabs "Dapr CLI" "HTTP API (Bash)" "HTTP API (PowerShell)">}}
|
{{< tabs "Dapr CLI" "HTTP API (Bash)" "HTTP API (PowerShell)">}}
|
||||||
|
|
||||||
|
@ -717,11 +721,15 @@ func main() {
|
||||||
}
|
}
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
//Using Dapr SDK to publish a topic
|
//Using Dapr SDK to publish a topic
|
||||||
=======
|
=======
|
||||||
//Using Dapr SDK to publish to a topic
|
//Using Dapr SDK to publish to a topic
|
||||||
>>>>>>> 0e83af7a (Added pub sub documentation)
|
>>>>>>> 0e83af7a (Added pub sub documentation)
|
||||||
|
=======
|
||||||
|
|
||||||
|
>>>>>>> 3380b73a (Changed port number in the command)
|
||||||
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)
|
||||||
|
@ -761,11 +769,15 @@ 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() {
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
var orderId = 100;
|
var orderId = 100;
|
||||||
=======
|
=======
|
||||||
var orderId = Math.floor(Math.random() * (1000 - 1) + 1);
|
var orderId = Math.floor(Math.random() * (1000 - 1) + 1);
|
||||||
>>>>>>> 0e83af7a (Added pub sub documentation)
|
>>>>>>> 0e83af7a (Added pub sub documentation)
|
||||||
|
=======
|
||||||
|
var orderId = 100;
|
||||||
|
>>>>>>> 3380b73a (Changed port number in the command)
|
||||||
start(orderId).catch((e) => {
|
start(orderId).catch((e) => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
@ -775,11 +787,14 @@ 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)
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
//Using Dapr SDK to publish a topic
|
//Using Dapr SDK to publish a topic
|
||||||
=======
|
=======
|
||||||
//Using Dapr SDK to publish to a topic
|
//Using Dapr SDK to publish to a topic
|
||||||
>>>>>>> 0e83af7a (Added pub sub documentation)
|
>>>>>>> 0e83af7a (Added pub sub documentation)
|
||||||
|
=======
|
||||||
|
>>>>>>> 3380b73a (Changed port number in the command)
|
||||||
await client.pubsub.publish("order_pub_sub", "orders", orderId);
|
await client.pubsub.publish("order_pub_sub", "orders", orderId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue