Delivering innovative event-driven features to the hands of users means moving micro-integrations from development to production. That means getting the right event infrastructure in the right environment at the right time. Event Portal makes that easier, faster and more resilient.

This code lab takes you through the lifecycle of a new event-driven application, from finding relevant events to jump start development, to generating rock-solid code, to automated event configuration with your existing CICD pipeline.

For all sections, you'll need to:

For config push and CICD integration sections, you will also need to:

Find interesting events to use in your solution

  1. In the home screen of Solace Cloud, click on Catalog.
    Image

  2. Within Catalog, click on the Events tab, then search for customer in the search box. You'll note that there are two existing customer events that would be perfect.
    Image

  3. Also, look for order related events by searching for order
    Image

Create an Application Domain to house your application, event and schema

  1. Now that we have candidate events, click on the Designer icon in the left bar (1), then Create Application Domain. (2)
    Image

  2. Configure the domain:
    Name (1): Customer360
    Description (2): collect customer behavior from across domains
    Add a Solace (3) topic domain of acmeretail/c360 (4)
    Select all 3 checkboxes, enforcing topic uniqueness (5), enforcing topic domain (6) and allowing descriptions to be edited (7)

Then click on OK
Image

Graphically create your application

  1. Go into the newly created Customer360 domain.

  2. Click on Add Objects and drag "New Application" to the canvas and name it Customer 360.
    Image

  3. Again click on Add Objects, and drag a Shared Event to the canvas
    Image

  4. In the popup, select Customer Updated, then click on Add.
  5. Repeat this process to add the Customer Created shared event, which you discovered in the catalog earlier.
  6. To define which events Customer 360 subscribes to, hover over the Customer Created event and drag the arrow to the Customer360 application. Repeat for the Customer Updated event.
    Image

  7. Drag a "New Event" onto the canvas and call it Customer Insight Generated.
  8. To define the event Customer 360 publishes, hover over the Customer360 application and drag the arrow to the Customer Insight Generated event.
    Image

Add an event directly from the catalog

  1. Navigate back to the catalog (1), click on the Events tab (2), select Order Created (3).
    Image

  2. In the right hand column, click on the latest version
    Image

  3. Click on Associate with Application
    Image

  4. Select the Customer360 domain (1), the latest Customer360 version (2), and specify that you want to subscribe to the event (3). Then click on Save.
    Image

Create consumers for your application

  1. In the resulting screen, scroll down to the Referenced By section, click on the three dots next to Customer 360, and then Open Application
    Image

  2. Click on Edit This Version
    Image

  3. Click on the Consumers tab (1), then on Add Consumer (2)
    Image

  4. Name the queue C360.ORDERS (1)
    give it a type of Solace Event Queue (2)
    Click on Set Configuration (3) to use the default configuration Then click on Add Subscriptions (4)
    Image

  5. In the resulting screen, select the Order Created event, which will prefill the subscription. Then click on Add Subscription
    Image

  6. Repeat the process to create the consumer for the two Customer events, naming the queue C360.CUSTOMERS When you click on Add Subscriptions, select both of the Customer events and a subscription for both.
    Image

  7. To save your changes, click on Save & Close.
    Image

Create a new Customer Insight Generated event

  1. You will use this schema file for the payload of the event. Download it and save it to your hard drive. Schema file
  2. Click on the Schemas tab (1)for the Customer360 domain, then click on Create Schema(2)
    Image
  3. Name the schema Customer Insight, then the Import from File button. Navigate to the customerinsight.json schema file you just downloaded.
    Image
  4. Click on Save and Close.
  5. Click on the Events tab (1) at the top of the screen, then click on Customer Insight Generated (2).
    Image
  6. Click on Edit This Version
    Image
  7. Define the Topic Address. Start by clicking on the field and selecting the acmeretail/c360 topic domain
    Image
  8. Type in the remainder of the topic address, using brackets for parameters. The final result should be: acmeretail/c360/customerinsight/generated/v1/{insighttype}/{customerid}
    Image
  9. Scroll down further and click on Select Schema.
    Image
  10. Select the Customer Insight schema you just created.
    Image

AsyncAPI export

  1. Click on Applications (1) in the top menu, then on Customer360(2)
    Image

  2. Click on the three dots next to version 0.1.0 and click on Download AsyncAPI. Save the file on your hard drive.
    Image

  3. In a web browser, navigate to AsyncAPI Studio at https://studio.asyncapi.com
    Image

  4. Click on the three dots in main panel (1), then on Import File. (2)
    Image

  5. In the resulting pop up, change the conversion to version 2.6.0, then click on Convert.
    Image

  6. Now that the AsyncAPI is loaded you can browse it, and also look through the autocreated documentation.
  7. When you're finished browsing, click again on the three dots (1), then click on Generate code/docs.(2)
    Image

  8. In the popup window, select Java Spring Cloud Stream Project, then click on Generate.
  9. Save the resulting .zip file to your hard drive.

Assign your application to an environment/event broker

  1. Click on Applications, then on Customer360.
    Image

  2. Click on the Runtime tab.
    Image

  3. Expand the Prod environment, then click on the three dots next to PROD-solace, then on Manage Credentials.
    Image

  4. For the Username enter c360 (1). For the Password enter c360 (2). Click on Save. (3)
    Image

  5. Back in the main screen, expand the Prod environment (1) again click on the three dots, and then "Add Application" (2)
    Image

  6. The resulting popup previews the changes that will occur. Expand out the credentials (1) and queues (2) to see more details. Then click on Add (3)
    Image

Confirm EP provisioned your queues and access

  1. Go to the management console of your cloud broker by clicking Cluster Manager in the left hand column, then clicking on your Event Broker.
    Image

  2. Click on the Manage tab (1), then Queues (2).
    Image

  3. You should see the two queues you defined earlier, C360.CUSTOMERS and C360.ORDERS. Clicking on each, you should see that they are owned by c360, only the owner is allowed to access the queue and the subscriptions you defined are in place.
    Image

  4. Click on Access Control (1), the Client Usernames tab (2), and you should see the c360 client username. (3)
    Image

  5. Click on the ACL Profiles tab (1) and you should see the ACL associated with your user. (2)
    Image

View the updated event flow for Production

  1. Click on the Runtime Event Manager icon on the left hand side (1), then on the us-central-solace-Prod event mesh. (2)
    Image

  2. Scroll down the list of applications in the left column to find Customer360, then click on the three dots (1). Then select Center on Graph. (2) This highlights the Customer360 on the graph.
    Image

  3. To highlight only the direct dependencies for Customer360 in Production, click on the three dots (1), then Show Relationships(2).
    Image

Remove application from runtime event broker and modelled event Mesh

  1. Click on the Customer360 link in the left hand column.
    Image

  2. In the resulting popup, click on Open in Designer.
    Image

  3. Click on the Runtime tab.
    Image

  4. Expand the Prod tab (1), click the three dots(2), the click on Remove Application.(3)
    Image

  5. In the popup, review the details of what queues will be removed. Then click on Remove
    Image

Create new repository with Event Portal GitHub Actions

  1. Make sure you are logged into GitHub and go to the Import Existing Repository page.
  2. Use https://github.com/SolaceLabs/ep-scs-workflow for the URL, list yourself as the owner, and name the new repository customer360. Click on Begin Import.
    Image

  3. Wait for the import to complete, usually around 3 minutes. Then click on the link to open the repository.

Configure GitHub Actions

  1. In the top menu of the repository, select Settings.
    Image

  2. In the left hand column, select Actions(1), then General (2).
    Image

  3. Scroll to the bottom of the page, and click on the radio button next to Read and write permissions (1). Then click on Save.(2)
    Image

  4. Again in the left hand column, scroll down, expand Secrets and variables (1), then click on Actions (2).
    Image

  5. In the main panel, click on New Repository Secret.
    Image

  6. Name the secret SOLACE_CLOUD_TOKEN. The value of the secret should be the token you created for Postman when initially populating your account.
    Image

Upload micro-integration to GitHub

  1. Unzip the Spring Cloud Stream source code you downloaded from studio.asyncapi.com on your hard drive.
  2. In the root directory, move the asyncapi.yml file to the template directory.
    Image

  3. Navigate to the template directory. It should look like this:
    Image

  4. In your browser go to the new repository, click on the plus sign (1), then on Upload files. (2)
    Image

  5. Select all 4 of files/subdirectories in the template directory, then click on OK

Commit the files and open a pull request

  1. In the resulting window, change the radio button to Create a new branch for this commit. Then click on Propose changes.
    Image

  2. In the next screen, click on Create pull request.
    Image

  3. The GitHub Actions kick off. When they are finished, there should be a list of changes that will occur should the pull request be approved.
    Image

  4. Scroll down to the bottom of the pull request and click on Merge pull request. Then click on Confirm merge.
    Image

  5. Using the management console of your cloud broker, confirm that the CICD process created the same queues, subscriptions, ACLs as manual promotion.

Soly Image Caption

Thanks for participating in this codelab! Let us know what you thought in the Solace Community Forum! If you found any issues along the way we'd appreciate it if you'd raise them by clicking the Report a mistake button at the bottom left of this codelab.