Support passwordless connections for JMS ServiceBus in Spring#33489
Conversation
|
API change check APIView has identified API level changes in this PR and created following API reviews. spring-cloud-azure-autoconfigure |
|
/azp run java - spring - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
The resource scopes in ServiceBus is the same for different Clouds: "https://servicebus.azure.net/.default". |
| * | ||
| * @since 4.7.0 | ||
| */ | ||
| public class AzureServiceBusCredentialSupplier implements Supplier<String> { |
There was a problem hiding this comment.
| public class AzureServiceBusCredentialSupplier implements Supplier<String> { | |
| public class AzureServiceBusJmsCredentialSupplier implements Supplier<String> { |
?
| String remoteUrl = String.format(AMQP_URI_FORMAT, host, properties.getIdleTimeout().toMillis()); | ||
| String username = serviceBusConnectionString.getSharedAccessKeyName(); | ||
| String password = serviceBusConnectionString.getSharedAccessKey(); | ||
| String remoteUrl = null; |
There was a problem hiding this comment.
The ServiceBusJmsConnectionFactory shouldn't need to understand the serviceBusPasswordlessProperties
There was a problem hiding this comment.
I have refactored the code, I provided a ServiceConnectionStringProvider, but it's a little strange for me now. Maybe we can discuss about it.
There was a problem hiding this comment.
ServiceConnectionStringProvider is not the best choice.
| @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) | ||
| @ActiveProfiles("servicebus-jms-passwordless") | ||
| public class ServiceBusJmsPasswordlessIT { | ||
| private static final Logger LOGGER = LoggerFactory.getLogger(ServiceBusJmsPasswordlessIT.class); | ||
| private static final String DATA = "service bus jms passwordless test"; | ||
| private static final String QUEUE_NAME = "que001"; | ||
| private final Exchanger<String> EXCHANGER = new Exchanger<>(); | ||
|
|
||
| @Autowired | ||
| private JmsTemplate jmsTemplate; | ||
|
|
||
| @Test | ||
| @Timeout(70) | ||
| public void testServiceBusJmsOperation() throws InterruptedException { | ||
| LOGGER.info("ServiceBusJmsPasswordlessIT begin."); | ||
| jmsTemplate.convertAndSend(QUEUE_NAME, DATA); | ||
| LOGGER.info("Send message: {}", DATA); | ||
| String msg = EXCHANGER.exchange(null); | ||
| Assertions.assertEquals(DATA, msg); | ||
| LOGGER.info("ServiceBusJmsPasswordlessIT end."); | ||
| } | ||
|
|
||
| @JmsListener(destination = QUEUE_NAME, containerFactory = "jmsListenerContainerFactory") | ||
| public void receiveQueueMessage(String message) throws InterruptedException { | ||
| LOGGER.info("Received message from queue: {}", message); | ||
| EXCHANGER.exchange(message); | ||
| } | ||
| } |
|
/azp run java - spring - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Azure Pipelines successfully started running 1 pipeline(s). |
34366bd to
61ee897
Compare
|
/azp run java - spring - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run java - spring - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run java - spring - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run java - spring - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
No pipelines are associated with this pull request. |
1 similar comment
|
No pipelines are associated with this pull request. |
|
/azp run java - spring - tests-weekly |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
pipeline: java - spring - tests ✅ |
…33489) Support passwordless connections for JMS ServiceBus in Spring.
Description
Linked issue: #32463
The PR is an implementation to support passwordless connections for JMS ServiceBus in Spring.
Test locally
IT
pipeline: java - spring - tests ✅
pipeline: java - spring - tests-weekly ✅