2

I try to connect to MQTT server and I have some problems adding the password:

The configuration file is:

mqtt:
  clients:
    client-ptl-mqtt: 
      serverUri: tcp://rdabeg01.inetpsa.com:1883
      clientId: LOCAL_PTL_SIMUL_MQTT
      connection:
        userName: xxxxxx
        password: xxxxxxx
      reconnectionMode: ALWAYS

And the error when i try to start the application is:

org.seedstack.coffig.internal.ConfigurationException: [CONFIGURATION] Illegal conversion

Description ----------- Cannot convert to char(char.java:1): 'xxxxxxx'.

Stacktrace

    at org.seedstack.coffig.internal.ConfigurationException.createNew(ConfigurationException.java:30)
    at org.seedstack.coffig.mapper.ValueMapper.charOf(ValueMapper.java:63)
    at org.seedstack.coffig.mapper.ValueMapper.map(ValueMapper.java:51)
    at org.seedstack.coffig.mapper.CompositeMapper.map(CompositeMapper.java:50)
    at org.seedstack.coffig.mapper.EvaluatingMapper.map(EvaluatingMapper.java:65)`
Adrien LAUER
  • 444
  • 2
  • 7
Jose M
  • 21
  • 2

1 Answers1

1

SeedStack MQTT addon relies on Paho which has a configuration class for the client connection MqttConnectOptions. The password field expects a char array, which the addon does not alter. Your YAML modified accordingly :

mqtt:
  clients:
    client-ptl-mqtt: 
      serverUri: tcp://rdabeg01.inetpsa.com:1883
      clientId: LOCAL_PTL_SIMUL_MQTT
      connection:
        userName: xxxxxx
        password: [ 'p', 'a', 's', 's', 'w', 'o', 'r', 'd' ]
      reconnectionMode: ALWAYS
notoon
  • 31
  • 1
  • 6