Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection refused when using EventHubsTransportType.AmqpWebSockets #32

Closed
jdiekhoff-copeland opened this issue Aug 22, 2024 · 2 comments
Assignees

Comments

@jdiekhoff-copeland
Copy link

jdiekhoff-copeland commented Aug 22, 2024

Describe the bug
Running containers in the same docker bridge network and attempting to connect via using EventHubsTransportType.AmqpWebSockets results in a connection refused.

To Reproduce

Sample compose:

services:
  my-service:
    image: "my-image:latest"
    environment:
      EventHub__ConnectionString: Endpoint=sb://eventhub;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;
    networks:
      - network
    depends_on:
      - eventhub
  eventhub:
    image: "mcr.microsoft.com/azure-messaging/eventhubs-emulator:1.2.4-preview-amd64"
    volumes:
      - "./config.json:/Eventhubs_Emulator/ConfigFiles/Config.json"
    environment:
      BLOB_SERVER: eventhub-azurite
      METADATA_SERVER: eventhub-azurite
      ACCEPT_EULA: ${EH_ACCEPT_EULA}
    depends_on:
      - eventhub-azurite
    networks:
      - network
  eventhub-azurite:
    image: "mcr.microsoft.com/azure-storage/azurite:latest"
    networks:
      - network

networks:
  network:

Expected behavior
Container should be able to connect to the event hub.

Screenshots
2024-08-21_20-23-31

Logs
log2024082200.txt

Desktop:

  • OS: Windows 10 Enterprise

Image Platform-Architecture Used:

  • Linux-amd64

Docker Version:

  • Docker Desktop Version (If applicable): 4.32.0
  • Docker Engine Version: 27.0.3

Arguments && Environment variables to start Emulator:

  • ACCEPT_EULA: Y
  • CONFIG_PATH: "./config.json:/Eventhubs_Emulator/ConfigFiles/Config.json"

Emulator Launch Method:

  • Direct Docker compose

Additional context:

I am able to connect fine if I leave the TransportType to the default, but I don't see anything in the documentation for the emulator that AmqpWebSockets is unsupported.

@jdiekhoff-copeland jdiekhoff-copeland changed the title Connection refused connecting from another container running 1.2.4-preview Connection refused when using EventHubsTransportType.AmqpWebSockets Aug 22, 2024
@Saglodha
Copy link
Collaborator

Hi @jdiekhoff-copeland , thanks for bringing this to our attention. As of today, Event Hubs emulator only works with Default AMQP flow and AMQPWebsockets is not supported. We'll update our documentation to reflect this accordingly.

To understand the situation better, could you please share more details on your use case and why you'd prefer AMQPwebsockets over traditional AMQP?

@jdiekhoff-copeland
Copy link
Author

@Saglodha good to know, I will update our code accordingly.

The use of AMQPwebsockets was being done for local development as a workaround. Prior to using the eventhub emulator, our development team was testing against Azure Eventhubs. We noticed when we were on VPN that the normal connection to EventHubs was not working, and we were getting socketexception 10054. We found this stackoverflow and by setting the TransportType to AMQPWebSockets allowed for normal operations.

Now that we are using the emulator, we do not have a use case for AMQPWebSockets since all traffic is local.

@Saglodha Saglodha self-assigned this Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants