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

conditional support jms via spring.jms.servicebus.enabled config #50

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ spring:
visits-requests: visits-requests
visits-confirmations: visits-confirmations
servicebus:
enabled: false # disable messaging support by default
namespace: ${SERVICEBUS_NAMESPACE}
pricing-tier: premium
passwordless-enabled: true
Expand Down
3 changes: 2 additions & 1 deletion docs/09_lab_messaging/0901.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The connection to the Service Bus needs to be stored in the `spring.jms.serviceb
visits-requests: visits-requests
visits-confirmations: visits-confirmations
servicebus:
enabled: true
namespace: ${SERVICEBUS_NAMESPACE}
pricing-tier: premium
passwordless-enabled: true
Expand Down Expand Up @@ -84,7 +85,7 @@ The connection to the Service Bus needs to be stored in the `spring.jms.serviceb

1. In the config repository you will need to add the service bus connection information. Replace the contents of the current `application.yml` file with the contents of the [0901_application.yml file](0901_application.yml). The service bus namespace and identity client id will be injected via environment variables. This file includes the following change:

- An additional `spring.jms` section from lines `16` to `26`.
- An additional `spring.jms` section after the `spring.sql` section.

1. Commit and push your changes to the remote repository.

Expand Down
1 change: 1 addition & 0 deletions docs/09_lab_messaging/0901_application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ spring:
visits-requests: visits-requests
visits-confirmations: visits-confirmations
servicebus:
enabled: true
namespace: ${SERVICEBUS_NAMESPACE}
pricing-tier: premium
passwordless-enabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.Date;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.samples.petclinic.visits.entities.VisitRequest;
Expand All @@ -14,6 +15,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@ConditionalOnProperty(name = "spring.jms.servicebus.enabled", havingValue = "true")
@Component
@Slf4j
@RequiredArgsConstructor
Expand Down
Loading