Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
Updated to use Service Bus using @torosent code
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbour committed Nov 11, 2018
1 parent ada82b4 commit e73430b
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 198 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
@@ -0,0 +1,4 @@
Dockerfile
README.md
.gitignore
azure-pipelines.yml
6 changes: 4 additions & 2 deletions Dockerfile
Expand Up @@ -29,13 +29,15 @@ COPY --from=builder /go/src/captureorderfd .
# Define environment variables
# Application Insights
ENV APPINSIGHTS_KEY=

# PLEASE DO NOT OVERRIDE UNLESS INSTRUCTED BY PROCTORS
ENV CHALLENGEAPPINSIGHTS_KEY=23c6b1ec-ca92-4083-86b6-eba851af9032

# Challenge Logging
ENV TEAMNAME=

# AMQP
ENV AMQPURL=
# AMQP for Service Bus
ENV AMQPURL="amqps://[policy name]:[policy key]@[yourServiceBus].servicebus.windows.net/[queuename]"

# Mongo/Cosmos
ENV MONGOURL=
Expand Down
13 changes: 4 additions & 9 deletions README.md
Expand Up @@ -33,6 +33,7 @@ The following environment variables need to be passed to the container:
```
ENV TEAMNAME=[YourTeamName]
ENV APPINSIGHTS_KEY=[YourCustomApplicationInsightsKey] # Optional, create your own App Insights resource
ENV CHALLENGEAPPINSIGHTS_KEY=[Challenge Application Insights Key] # Override, if given one by the proctors
```

### For MongoDB
Expand All @@ -47,19 +48,13 @@ ENV MONGOURL=mongodb://[mongoinstance].[namespace]
ENV MONGOURL=mongodb://[CosmosDBInstanceName]:[CosmosDBPrimaryPassword]=@[CosmosDBInstanceName].documents.azure.com:10255/?ssl=true&replicaSet=globaldb
```

### For RabbitMQ
### For Service Bus

```
ENV AMQPURL=amqp://[url]:5672
ENV AMQPURL=amqps://[policy name]:[policy key]@[yourServiceBus].servicebus.windows.net/[queuename]
```

### For Event Hubs

```
ENV AMQPURL=amqps://[policy name]:[policy key]@[youreventhub].servicebus.windows.net/[eventhubname]
```

Make sure your _policy key_ is URL Encoded. Use a tool like: <https://www.url-encode-decode.com/>
> Make sure your _policy key_ is URL Encoded. Use a tool like: <https://www.url-encode-decode.com/>
## Contributing

Expand Down
3 changes: 2 additions & 1 deletion controllers/order.go
Expand Up @@ -23,7 +23,8 @@ func (this *OrderController) Post() {
var ob models.Order
json.Unmarshal(this.Ctx.Input.RequestBody, &ob)


models.TrackInitialOrder(ob)

// Add the order to MongoDB
addedOrder, err := models.AddOrderToMongoDB(ob)

Expand Down

0 comments on commit e73430b

Please sign in to comment.