Your question isn’t exactly clear. When you say you are trying to “integrate your MQTT broker with application server” what do you mean by that?
Are you running Chirpstack V3 or V4? Chirpstack V3 is separated between an application server and a network server, and if this is what you mean by application server you should really just use Chirpstack V4, especially if you are new.
Is your goal to have an external application listen to the events on the Chirpstack MQTT Broker? or do you wish to send events to an external MQTT broker you have setup?
As you’re new I’m going to assume you are using V4, and are trying to add the integration events to Chirpstacks MQTT Broker, then have an external application subscribe to the Broker and see these events:
A bit of information first:
In the MQTT Event Types outlined in the documentation, the first four events: up/status/join/ack, should all already be being sent in your MQTT Broker, they are the four messages Chirpstack uses internally and requires to run, if you view your Chirpstack logs or subscribe to the MQTT Broker you should already see them. The rest of the events: txack, log, location, integration, are optional events that you can enable through the integrations section of your Chirpstack.toml. Note that the “integration event” is actually several events with the same topic format: application/<application_id>/device/<devEUI>/event/<event>
.
To enable these optional events, all that is necessary is to fill in the following configuration section in your chirpstack.toml, if you do not have an integration section you can add it:
[integration]
enabled=["mqtt"]
[integration.mqtt]
server="tcp://$MQTT_BROKER_HOST:1883/"
json=true
If you wish to instead send the optional events to an external MQTT Broker you could change the location in the server= line.
Then to view these events your application must subscribe to one of the brokers topics, either a specific topic or all of them using the “#” wildcard topic, you must figure out how to do this yourself for the purposes of your application. For debugging, you can subscribe to the MQTT broker yourself using:
mosquitto_sub -v -h broker_ip -p 1883 -t '#'
If you have done the steps bconway outlined here to enable TLS for your MQTT Broker using self-signed certificates, then you must use the mosquitto_sub command with the “MQTT Integration” certificates given through the web UI.
I hope this wasn’t too much of an information dump but it really is necessary to understand how Chirpstack works before trying to build anything on top of it. Good luck!