title: How can I transmit via MQTT and Receive on AMQP with RabbitMQ and Spring-AMQP
body: <p>So I've gotten MQTT -> MQTT and AMQP -> AMQP to work; the translation of MQTT -> AMQP doesn't seem to be working somewhere though. Here's my test, it passes if my "listener" is also in MQTT using paho, but this rabbitmq implementation doesn't.</p>
  
  <pre><code>@SpringBootTest
  @SpringJUnitConfig
  internal open class ProvisioningTest @Autowired constructor(
      private val mqtt: IMqttAsyncClient,
      private val mapper: ObjectMapper
  ) {
  
      @Test
      fun provision() {
          val entity = Foley(
              rfid = UUID.randomUUID().toString(),
          )
  
          val called = AtomicBoolean(false)
          mqtt.subscribe("foley/created", 1) { _, _ -&gt; called.set(true) }
  
          mqtt.publish("foley/new", MqttMessage(mapper.writeValueAsBytes(entity)))
  
          Awaitility.await().atMost(10, TimeUnit.SECONDS).untilTrue(called)
      }
  }
  </code></pre>
  
  <p>this is the listener that publishes the saved entity to the other queue; it never gets called when I publish to MQTT.</p>
  
  <pre><code>@Service
  open class Provisioning(private val repo: FoleyRepo) {
      private val log: Logger = LogManager.getLogger(this::class.java)
  
      @SendTo("foley.created")
      @RabbitListener(queuesToDeclare = [Queue("foley.new")] )
      open fun listen(entity: Foley): Foley {
          log.trace("saving: {}", entity)
          val save = repo.save(entity)
          log.debug("saved: {}", save)
          return save
      }
  
  }
  </code></pre>
  
  <p>the entirety of my messaging configuration</p>
  
  <pre><code>@Configuration
  open class MessagingConfig {
  
      @Bean
      open fun client(
          @Value("tcp://\${mqtt.client.host:localhost}:\${mqtt.client.port:1883}") uri: String,
          @Value("\${mqtt.client.user:#{null}}") user: String?,
          @Value("\${mqtt.client.pass:#{null}}") pass: CharArray?
      ): IMqttAsyncClient {
  
          val connOpt = MqttConnectOptions()
          user?.let { connOpt.userName = it }
          pass?.let { connOpt.password = it }
          connOpt.isCleanSession = false
          connOpt.isAutomaticReconnect = true
          val client = MqttAsyncClient(uri, MqttAsyncClient.generateClientId(), MemoryPersistence())
          client.connect(connOpt)
          return client
      }
  
      @Bean
      open fun messageConverter( om: ObjectMapper): MessageConverter {
          return Jackson2JsonMessageConverter(om)
      }
  
      @Bean
      open fun builder(): Jackson2ObjectMapperBuilderCustomizer {
          return Jackson2ObjectMapperBuilderCustomizer {
              it.modules(JavaTimeModule(), KotlinModule())
          }
      }
  }
  </code></pre>
  
  <p>using the <a href="https://hub.docker.com/_/rabbitmq" rel="nofollow noreferrer">official docker rabbitmq</a> image with mqtt enabled.</p>
  
  <p>What do I need to correct to make this work?</p>