class SubscriptionService implements MqttClientEventHandler {

    @Override
    public void onSubscribe(final MqttClientAdapter mqttClientAdapter, final Mqtt3SubAck subAck,
            final Throwable throwable) {
        final MessageMetadata messageMetadata = mqttClientAdapter.getMessageMetadata();
        if (throwable == null) {
            LOG.info(String.format("Client subscribed for device:%s suback:%s",
                    messageMetadata.getDeviceIdentification(), subAck.getType()));
        } else {
            LOG.info(String.format("Client subscription for device:%s failed",
                    messageMetadata.getDeviceIdentification()), throwable);
        }
    }

    public  SubscriptionService(final MqttDeviceRepository mqttDeviceRepository,
            final MqttClientAdapterFactory mqttClientAdapterFactory,
            final OutboundOsgpCoreResponseMessageSender outboundOsgpCoreResponseMessageSender,
            @Value("#{new Integer('${mqtt.broker.defaultPort}')}") final int defaultPort,
            @Value("${mqtt.broker.defaultTopics}") final String defaultTopics,
            @Value("${mqtt.broker.defaultQos}") final String defaultQos);

}