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

spring-cloud-azure-stream-binder-eventhubs connecting to Azure China eventhub #30936

Closed
yumingtao opened this issue Sep 13, 2022 · 4 comments
Closed
Assignees
Labels
azure-spring All azure-spring related issues azure-spring-eventhubs Spring event hubs related issues. bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization.
Milestone

Comments

@yumingtao
Copy link

yumingtao commented Sep 13, 2022

I am using spring-cloud-azure-stream-binder-eventhubs connecting to eventhub, I tried to config it in properties, but it always connects to domain "servicebus.windows.net", could you help with this issue, thanks.

<dependency>
    <groupId>com.azure.spring</groupId>
    <artifactId>spring-cloud-azure-stream-binder-eventhubs</artifactId>
    <version>4.3.0</version>
</dependency>

the configuraton in properties:

spring.cloud.azure.eventhubs.connection-string=${EVENTHUB_CONNECTION_STRING:Endpoint=sb://xxx.servicebus.chinacloudapi.cn/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=***}
spring.cloud.azure.eventhubs.processor.checkpoint-store.account-key=${EVENTHUB_CHECKPOINT_ACCESS_KEY:t***}
spring.cloud.azure.eventhubs.processor.checkpoint-store.account-name=${EVENTHUB_CHECKPOINT_STORAGE_ACCOUNT:xxx}
spring.cloud.azure.eventhubs.processor.checkpoint-store.container-name=${EVENTHUB_NAME:xxx}
spring.cloud.azure.eventhubs.namespace=mycar-dev-cn-cn3-eventhub-na
spring.cloud.azure.eventhubs.domain-name=**servicebus.chinacloudapi.cn**
spring.cloud.azure.profile.cloud-type=**azure_china**
spring.cloud.azure.eventhubs.processor.checkpoint-store.profile.cloud-type=**azure_china**
spring.cloud.azure.servicebus.domain-name=**servicebus.chinacloudapi.cn**
spring.cloud.azure.eventhubs.profile.cloud-type=**azure_china**
spring.cloud.azure.appconfiguration.profile.cloud-type=**azure_china**

the console output:

reactor.core.Exceptions$ErrorCallbackNotImplemented: com.azure.core.amqp.exception.AmqpException: errorContext[NAMESPACE: mycar-dev-cn-cn3-eventhub-na.servicebus.windows.net. ERROR CONTEXT: N/A]
Caused by: com.azure.core.amqp.exception.AmqpException: errorContext[NAMESPACE: mycar-dev-cn-cn3-eventhub-na.servicebus.windows.net. ERROR CONTEXT: N/A]
	at com.azure.core.amqp.implementation.ExceptionUtil.toException(ExceptionUtil.java:85)
	at com.azure.core.amqp.implementation.handler.ConnectionHandler.notifyErrorContext(ConnectionHandler.java:332)
	at com.azure.core.amqp.implementation.handler.ConnectionHandler.onTransportError(ConnectionHandler.java:235)
	at org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:191)
	at org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108)
	at org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:324)
	at org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:291)
	at com.azure.core.amqp.implementation.ReactorExecutor.run(ReactorExecutor.java:91)
	at org.springframework.cloud.sleuth.instrument.reactor.ReactorSleuth.lambda$null$6(ReactorSleuth.java:324)

PS: When using 4.0.0 version, but the artifactid is azure-spring-cloud-stream-binder-eventhubs, it works with a simple configuration in properties.

<dependency>
    <groupId>com.azure.spring</groupId>
    <artifactId>**azure-spring-cloud-stream-binder-eventhubs**</artifactId>
    <version>4.0.0</version>
</dependency>
spring.cloud.azure.eventhubs.connection-string=${EVENTHUB_CONNECTION_STRING:Endpoint=sb://xxx.servicebus.chinacloudapi.cn/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=*****}
spring.cloud.azure.eventhubs.processor.checkpoint-store.account-key=${EVENTHUB_CHECKPOINT_ACCESS_KEY:****}
spring.cloud.azure.eventhubs.processor.checkpoint-store.account-name=${EVENTHUB_CHECKPOINT_STORAGE_ACCOUNT:xxx}
spring.cloud.azure.eventhubs.processor.checkpoint-store.container-name=${EVENTHUB_NAME:dev-wallbox-v2-hub}
spring.cloud.azure.eventhubs.namespace=mycar-dev-cn-cn3-eventhub-na
spring.cloud.azure.profile.cloud-type=**azure_china**
spring.cloud.azure.eventhubs.processor.checkpoint-store.profile.cloud-type=**azure_china**
@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Sep 13, 2022
@saragluna saragluna self-assigned this Sep 14, 2022
@saragluna saragluna added azure-spring All azure-spring related issues azure-spring-eventhubs Spring event hubs related issues. labels Sep 14, 2022
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Sep 14, 2022
@saragluna saragluna added bug This issue requires a change to an existing behavior in the product in order to be resolved. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Sep 14, 2022
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Sep 14, 2022
@saragluna saragluna moved this to Todo in Spring Cloud Azure Sep 14, 2022
@saragluna saragluna added this to the 2022-10 milestone Sep 14, 2022
@saragluna
Copy link
Member

Thanks @yumingtao for reaching out, we are aware of this issue and it's a bug in the code. I believe this PR #30534 will fix it.

@saragluna saragluna moved this from Todo to In Progress in Spring Cloud Azure Sep 16, 2022
@saragluna saragluna moved this from In Progress to Pending Review in Spring Cloud Azure Sep 20, 2022
@saragluna
Copy link
Member

Hi @yumingtao, PR #30534 has been merged. Could you please try the latest version from the main branch to see whether it works?

You could follow this instruction to build the libraries locally https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring#build-from-source.

And then replace the version used in your project with 4.4.0-beta.1:

<dependencies>
  <dependency>
      <groupId>com.azure.spring</groupId>
      <artifactId>spring-cloud-azure-stream-binder-eventhubs</artifactId>
  </dependency>
</dependencies>
<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>com.azure.spring</groupId>
      <artifactId>spring-cloud-azure-dependencies</artifactId>
      <version>4.4.0-beta.1</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

@saragluna saragluna moved this from Pending Review to Need Author Feedback in Spring Cloud Azure Sep 20, 2022
@saragluna
Copy link
Member

saragluna commented Sep 28, 2022

GA version 4.4.0 has been released, closing this issue now. Please reopen if you still run into problems

<dependencies>
  <dependency>
      <groupId>com.azure.spring</groupId>
      <artifactId>spring-cloud-azure-stream-binder-eventhubs</artifactId>
  </dependency>
</dependencies>
<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>com.azure.spring</groupId>
      <artifactId>spring-cloud-azure-dependencies</artifactId>
      <version>4.4.0</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

Repository owner moved this from Need Author Feedback to Done in Spring Cloud Azure Sep 28, 2022
@yumingtao
Copy link
Author

@saragluna Sorry for replying late due to the vacation, I ran the test sample, and the 4.4.0 version works well for Azure China, thanks.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
azure-spring All azure-spring related issues azure-spring-eventhubs Spring event hubs related issues. bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization.
Projects
Archived in project
Development

No branches or pull requests

2 participants