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

CAMEL-21871: camel-azure-serviebus - TokenCredential is autowired, an… #17735

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

davsclaus
Copy link
Contributor

…d ensure if explicit configured on component then that is used.

Description

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

…d ensure if explicit configured on component then that is used.
Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟

🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run

  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot.

  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.

  • Build and test logs are available in the Summary page. Only Apache Camel committers have access to the summary.

  • ⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

…d ensure if explicit configured on component then that is used.
@oscerd
Copy link
Contributor

oscerd commented Apr 12, 2025

I think there are others components doing that in azure space

@davsclaus
Copy link
Contributor Author

I think there are others components doing that in azure space

Ah yeah it seems they all should ideally be made to use autowired - its a bit more work to do them all

@anirudh-04
Copy link
Contributor

@davsclaus wouldn't createServiceBusSenderClient invocation give npe because of the switch case -

        switch (configuration.getCredentialType()) {
            case CONNECTION_STRING -> builder.connectionString(configuration.getConnectionString());
            case TOKEN_CREDENTIAL -> builder.credential(fullyQualifiedNamespace, credential);
            case AZURE_IDENTITY -> builder.credential(fullyQualifiedNamespace, new DefaultAzureCredentialBuilder().build());
        }

Test to replicate, do we need to handle this?

    @Test
    void testCreateBaseServiceBusClientWithNoCredentialType() throws Exception {
        ServiceBusConfiguration configuration = new ServiceBusConfiguration();
        ServiceBusClientFactory factory = new ServiceBusClientFactory();
        final ServiceBusSenderClient senderClient = factory.createServiceBusSenderClient(configuration);

        assertNotNull(senderClient);
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants