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

Add EventHub support to Bookshop #425

Merged
merged 9 commits into from
Jan 16, 2025
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
8 changes: 8 additions & 0 deletions bookshop-mt-messaging-eh.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"ceSource": [
"/cf-eu10-canary/sap.cdsjavait"
],
"deploymentRegion": "cf-eu10-canary",
"displayName": "CAP Multi-Tenant Bookshop for Messaging BTP Integration Test",
"webhookUrl": "https://localhost/messaging/v1.0/eb"
}
51 changes: 49 additions & 2 deletions mta-multi-tenant-messaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ modules:
memory: 1024M
disk-quota: 512M
buildpack: sap_java_buildpack_jakarta
routes:
- route: '${default-url}'
- route: '${default-host}.cert.${default-domain}'
properties:
CDS_MULTITENANCY_APPUI_TENANTSEPARATOR: "-"
JBP_CONFIG_COMPONENTS: "jres: ['com.sap.xs.java.buildpack.jre.SAPMachineJRE']"
Expand All @@ -27,6 +30,15 @@ modules:
- name: bookshop-mt-messaging-kafka
- name: bookshop-mt-messaging-em
- name: bookshop-mt-messaging-mq
- name: bookshop-mt-messaging-eh
parameters:
config:
authentication-type: X509_IAS
- name: bookshop-mt-messaging-identity
parameters:
config:
credential-type: "X509_GENERATED"
app-identifier: "bs-mt-messaging-srv" # max 20 characters is allowed
- name: bookshop-mt-messaging-service-manager
- name: bookshop-mt-messaging-uaa
- name: bookshop-mt-messaging-saas-registry
Expand All @@ -41,6 +53,7 @@ modules:
- name: srv-api
properties:
srv-url: '${default-url}'
srv-cert-url: 'https://${default-host}.cert.${default-domain}'
# --------------------- SIDECAR MODULE -----------------------
- name: bookshop-mt-messaging-sidecar
# ------------------------------------------------------------
Expand Down Expand Up @@ -111,6 +124,33 @@ resources:
service: message-queuing
service-plan: standard
path: bookshop-mt-messaging-mq.json
- name: bookshop-mt-messaging-eh
type: org.cloudfoundry.managed-service
parameters:
service: eventmesh-sap2sap-internal
service-plan: event-mesh-multi-tenant
path: bookshop-mt-messaging-eh.json
config: # webhookUrl needs to be overwritten build url with placeholders
webhookUrl: "~{srv-api/srv-cert-url}/messaging/v1.0/eb"
requires:
- name: srv-api
- name: bookshop-mt-messaging-identity
type: org.cloudfoundry.managed-service
parameters:
service: identity
service-plan: application
config:
multi-tenant: false
oauth2-configuration:
redirect-uris:
- "https://*.${default-domain}/**"
- "https://*.internal.${default-domain}/node/signin-oidc/*"
consumed-services:
- service-instance-name: bookshop-mt-messaging-eh
requires:
- name: bookshop-mt-messaging-eh
processed-after:
- bookshop-mt-messaging-eh
- name: bookshop-mt-messaging-uaa
type: org.cloudfoundry.managed-service
parameters:
Expand Down Expand Up @@ -144,8 +184,15 @@ resources:
onUnSubscriptionAsync: true
onUpdateDependenciesAsync: true
callbackTimeoutMillis: 3600000
displayName: bookshop-java
description: A simple CAP Java project.
# use 'managedService' only if onboarded to UCL happened using Unified Service (ie. MAP)
# BTP integration tests use external systems in UCL at the moment
# managedService:
# applicationResourceType:
# group: bookshop-integration-test.java-runtime.dev.cap.sap
# type: BookshopIntegrationTestTenant
# version: v1
displayName: bookshop-mt-messaging-${org}-${space} # this is used as name in the subscription dashboard
description: CAP Multi-Tenant Bookshop for Messaging BTP Integration Test.
category: 'Category'
requires:
- name: srv-api
Expand Down
34 changes: 34 additions & 0 deletions srv/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ cds:
mq-messaging:
binding: bookshop-mt-messaging-mq
enabled: false
eh-messaging:
binding: bookshop-mt-messaging-eh
enabled: false

---
spring:
Expand All @@ -163,6 +166,9 @@ cds:
mq-messaging:
binding: bookshop-mt-messaging-mq
enabled: false
eh-messaging:
binding: bookshop-mt-messaging-eh
enabled: false

---
spring:
Expand All @@ -182,6 +188,30 @@ cds:
enabled: false
persistent:
enabled: false
eh-messaging:
binding: bookshop-mt-messaging-eh
enabled: false

---
spring:
config.activate.on-profile: eh-messaging-cloud
cds:
messaging.services:
kafka-messaging:
binding: bookshop-mt-messaging-kafka
enabled: false
em-messaging:
binding: bookshop-mt-messaging-em
enabled: false
bupa-messaging:
binding: bookshop-mt-messaging-mq
enabled: false
eh-messaging:
binding: bookshop-mt-messaging-eh
outbox:
enabled: false
persistent:
enabled: false

---
spring:
Expand Down Expand Up @@ -224,3 +254,7 @@ cds:
mq-messaging:
binding: bookshop-mt-messaging-mq
enabled: false
eh-messaging:
binding: bookshop-mt-messaging-eh
enabled: false