class DefaultMessageMapperFactory implements MessageMapperFactory {

    @Override
    public MessageMapperRegistry registryOf(final MappingContext defaultContext,
            final PayloadMappingDefinition payloadMappingDefinition) {

        final MessageMapper defaultMapper = mapperOf("default", defaultContext)
                .map(WrappingMessageMapper::wrap)
                .orElseThrow(() -> new IllegalArgumentException("No default mapper found: " + defaultContext));

        final Map<String, MessageMapper> mappersFromConnectionConfig =
                instantiateMappers(payloadMappingDefinition.getDefinitions().entrySet().stream());

        final Map<String, MessageMapper> fallbackMappers =
                instantiateMappers(registeredMappers.entrySet().stream()
                        .filter(requiresNoMandatoryConfiguration())
                        .map(Map.Entry::getKey)
                        .map(this::getEmptyMappingContextForAlias));

        return DefaultMessageMapperRegistry.of(defaultMapper, mappersFromConnectionConfig, fallbackMappers);
    }

    private  DefaultMessageMapperFactory(final ConnectionId connectionId,
            final MappingConfig mappingConfig,
            final ExtendedActorSystem actorSystem,
            final List<MessageMapperExtension> messageMapperExtensions,
            final LoggingAdapter log);

}