Skip to content

Support detect Azure Event Hubs, connect by connection string.#8

Merged
rujche merged 2 commits into
azure-javaee:feature/sjadfrom
rujche:support-detect-event-hubs
Nov 1, 2024
Merged

Support detect Azure Event Hubs, connect by connection string.#8
rujche merged 2 commits into
azure-javaee:feature/sjadfrom
rujche:support-detect-event-hubs

Conversation

@rujche

@rujche rujche commented Oct 30, 2024

Copy link
Copy Markdown

Follow up of #6

Support detect Azure Event Hubs

  • Produce message only. Link to sample project.
    • Auth using user-assigned managed identity.
    • Auth using connection string.
  • Produce and consume message. Link to sample project
    • Auth using user-assigned managed identity.
    • Auth using connection string.

@rujche
rujche marked this pull request as ready for review November 1, 2024 01:11
name: connectionStringSecretName
parent: keyVault
properties: {
value: 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};AccountKey=${storageAccount.listKeys().keys[0].value};EndpointSuffix=${environment().suffixes.storage}'

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: This is different to Event Hubs and Service Bus.

{{- if (and .AzureEventHubs .AzureEventHubs.AuthUsingManagedIdentity) }}
{
name: 'SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTION_STRING'
name: 'SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTIONSTRING'

@rujche rujche Nov 1, 2024

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: Both SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTION_STRING and SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTION_STRING SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTIONSTRING can work, but SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTION_STRING is the legacy format.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTIONSTRING?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. you are right. I updated the comment.

{{- if (and .AzureEventHubs .AzureEventHubs.AuthUsingConnectionString) }}
{
name: 'SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTION_STRING'
name: 'SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTIONSTRING'

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

{{- if (and .AzureStorageAccount .AzureStorageAccount.AuthUsingManagedIdentity) }}
{
name: 'SPRING_CLOUD_AZURE_STORAGE_CREDENTIAL_MANAGEDIDENTITYENABLED'
name: 'SPRING_CLOUD_AZURE_EVENTHUBS_PROCESSOR_CHECKPOINTSTORE_CONNECTIONSTRING'

@rujche rujche Nov 1, 2024

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: SPRING_CLOUD_AZURE_EVENTHUBS_PROCESSOR_CHECKPOINTSTORE_CONNECTION_STRING can not work.
Reason:

image

Convert all - to _ is supported, convert none is also supported. Convert sub set is not supported.

  1. Convert all: SPRING_CLOUD_AZURE_EVENTHUBS_PROCESSOR_CHECKPOINT_STORE_CONNECTION_STRING.
  2. Convert none: SPRING_CLOUD_AZURE_EVENTHUBS_PROCESSOR_CHECKPOINTSTORE_CONNECTIONSTRING.
  3. Convert sub set: SPRING_CLOUD_AZURE_EVENTHUBS_PROCESSOR_CHECKPOINTSTORE_CONNECTIO_NSTRING.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am just curious how they match the CHECKPOINT_STORE here, is it that if it's a camel case, such as aB, it will switch to A_B?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rujche
rujche merged commit 39fda8c into azure-javaee:feature/sjad Nov 1, 2024
@rujche
rujche deleted the support-detect-event-hubs branch November 1, 2024 06:08
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

Successfully merging this pull request may close these issues.

2 participants