dotnet-sdk icon indicating copy to clipboard operation
dotnet-sdk copied to clipboard

Unable to publish message to RabbitMQ

Open VenkateshSrini opened this issue 3 years ago • 10 comments

Expected Behavior

I'm using the Dapr .NET sdk and using PublishAsync method to publish messages to rabbit MQ. I expect the message to be published without any issues. I'm using it in Kubernetes. The code can be found at Daprpubsub. The code is also attached herewith.[DaprPubsub.zip]https://github.com/dapr/dotnet-sdk/files/6820240/DaprPubsub.zip) The configuration of the Rabbit MQ is perfect. The component definition is perfect. The dapr SDK is able to reach the rabbit MQ. In fact in the rabbitmq exchange, I was able to find an exchange created with the name of the topic name. There are

Actual Behavior

No Queue is getting created and Message is not present

Steps to Reproduce the Problem

  1. Install Rabbit MQ in the Kubernetes cluster using Helm from https://charts.bitnami.com/bitnami
  2. Update the component file with the amqp configuration.
  3. apply the component in the same name space as that of code
  4. Deploy the code.
  5. Execute Kubectl get svc and get the Loadbalancer external IP of the service daprpub. The port will be 5045..
  6. Assuming the external IP is something like localHost. Access the URL as http://localHost:5045/swagger. The swagger page will be displayed
  7. In the Swagger UI access the Put in queue method. The method executes without any exception.

Thanks

VenkateshSrini avatar Jul 15 '21 04:07 VenkateshSrini

Ant help in this regard will be greatly appreciated.

VenkateshSrini avatar Jul 16 '21 06:07 VenkateshSrini

Attached is the log from application. Is there any help that can be offered logs.txt

VenkateshSrini avatar Jul 26 '21 04:07 VenkateshSrini

Did you also install Dapr onto the cluster beforehand? Your code is fine so I suspect there is something missing in your deployment. Your logs are for the applications so I would look at the app sidecar and dapr pods logs too. I would look at the health of your cluster too.

Also, these references might be useful: https://github.com/dapr/quickstarts/tree/master/hello-kubernetes and https://docs.dapr.io/operations/hosting/kubernetes/kubernetes-deploy/

jbw avatar Aug 19 '21 21:08 jbw

@jbw , I have attached the Dapr logs from Sidecar Daprlogs.txt here with. Yes I followed the above instructions only to deploy Dapr to K8s. I had deployed before hand itself

VenkateshSrini avatar Aug 20 '21 01:08 VenkateshSrini

The logs don't contain anything for daprsub sidecar. If correctly configured you should see something like:

app is subscribed to the following topics: [topic name] through pubsub=pubsub" app_id=...

Your issue is with K8s so I would suggest looking at the example application in the links above and being able to observe the status of your cluster by inspecting logs, pods, etc using kubectl.

In the namespace dapr-system, there should be a dapr-dashboard deployment which you can port-forward into which might help also tools like Lens give a visual look into your cluster which can make it easier to inspect.

jbw avatar Aug 20 '21 12:08 jbw

@jbw, I have redeployed my application and did the steps once again. I'm not able to get the same working. I'm attaching the logs that I received. applog.txt dprSidecarlog.txt As you told I have also port forwarded the dapr dashboard. In that, in the overview section under Dapr Application heading, I see "daprpub" application. What else can I do to find what is wrong?

VenkateshSrini avatar Aug 25 '21 12:08 VenkateshSrini

@jbw any suggestions to resolve this issue

VenkateshSrini avatar Sep 23 '21 06:09 VenkateshSrini

I've raised a PR on your repo to demonstrate 👍🏽 . It's not a Dapr issue so you can close this issue 😃

jbw avatar Sep 26 '21 20:09 jbw

@VenkateshSrini @jbw - is there anything else to resolve here? This sounds like a general troubleshooting discussion and not a bug in the SDK.

rynowak avatar Sep 28 '21 20:09 rynowak

@rynowak , Yes I have installed Dapr first then only the app.

VenkateshSrini avatar Sep 29 '21 01:09 VenkateshSrini

Given the age of the issue, and the general nature of the question, I'm going to close this. If you still need help, feel free to reopen this issue or open a new one.

halspang avatar Aug 29 '22 21:08 halspang