Skip to content

Martini Generating Services when Consuming AsyncAPI

Martini's graphical interface simplifies the service generation process from AsyncAPI specifications, facilitating the creation of services for asynchronous messaging patterns. This guide provides step-by-step instructions using the Martini GUI as seen in the provided image.

Steps to Generate Services from an AsyncAPI Specification

  1. Open the 'Consume API' Dialog

    • In the Martini interface, open the 'Consume an API' dialog which is the starting point for generating new services.
  2. Specify the Location

    • In the 'Location' field, enter the directory within your Martini package where the generated services will reside. For example: /demo-api-crm/code.
  3. Choose the AsyncAPI Option

    • From the list of available API types, select 'AsyncAPI'. This tells Martini that you're going to generate services based on an AsyncAPI specification.
  4. Provide the AsyncAPI Specification

    • In the 'File/URL' field, input the location of your AsyncAPI specification. This can be done by dropping a file directly into the interface, browsing to a file's location, or entering a URL where the AsyncAPI specification is hosted.
  5. Logging (Optional)

    • If you wish to log requests for tracking and debugging purposes, check the 'Log requests to Tracker' option.
  6. Generate the Services

    • After providing all necessary information and configurations, click the 'Consume' button to instruct Martini to generate services based on the AsyncAPI specification.

Post-Generation Steps

After the services have been generated, it is recommended to:

  • Review the Generated Services: Analyze the created services for accuracy and completeness based on the AsyncAPI specification.
  • Customize as Necessary: Modify the service logic, input, and output to align with your business requirements.
  • Test the Services: Ensure that the services interact correctly with the asynchronous API by conducting thorough tests within Martini.