class InfoProviderFactory {

    public static ConnectionMonitor.InfoProvider forExternalMessage(final ExternalMessage externalMessage) {
        final String correlationId = extractCorrelationId(externalMessage.getHeaders());
        final Instant timestamp = Instant.now();
        final Supplier<String> payloadSupplier = supplyPayloadFromExternalMessage(externalMessage);

        return new ImmutableInfoProvider(correlationId, timestamp, null, externalMessage.getHeaders(), payloadSupplier,
                false);
    }

    private  InfoProviderFactory();

}