Skip to content

Integration

The Applications microservice offers some messages that can be published, as well as some events that other services can consume to keep up to date with new and updated Applications.

To get access to them, we need a reference to the Applications.Application.Contracts project as it is shown below:

XML
<ProjectReference Include="$(ServicesPath)Applications\ITsynch.Suite.Applications.Application.Contracts\ITsynch.Suite.Applications.Application.Contracts.csproj" />

From your module, you are able to publish the CreateOrUpdateApplication message.

If the application already exists, this will be updated with the data published in the message. If not, a new application is created.

If the operation succeeds, an ApplicationUpdated message is published.

C#
using ITsynch.Suite.Applications.Application;
using MassTransit;
using System.Threading.Tasks;

namespace ITsynch.Suite.Example.Application
{
    public class ApplicationsUpdatedConsumer : IConsumer<ApplicationUpdated>
    {
        public ApplicationUpdatedConsumer()
        {
        }

        public async Task Consume(ConsumeContext<ApplicationUpdated> context)
        {
            // do some stuff
        }
    }
}

Note

Note that ApplicationUpdated is published both when an application is created and updated.