Connection between mqtt binding and own developed binding

can we use mqtt binding in our own binding…
is there any way to connect my own developed binding with mqtt binding in openhab…??
by this i mean to say that whenver my binding requires mqtt service then it takes from mqtt binding?

I can’t answer definitively one way or the other. But I can say that while I’ve seen some Actions require the installation of a binding (e.g. the MQTT Action requires the MQTT Binding to be installed), I know of no Bindings that requires another binding be installed.

MQTT is so easy to implement I think it would be less work and a much better user experience if you just included the MQTT code in your binding than it would be to depend on another binding.

Ultimately you should also step back and ask whether this is something your binding should be doing in the first place or whether what you are trying to achieve is better handled in OH Items and Rules. That is the typical approach for the interaction between different protocols.

ok thank you sir…is it legal to use mqtt binding code in our own binding…i am asking about licensing terms…?

I believe all the official bindings like MQTT are Eclipse 2.0 Licenses but you will need to check the source code itself. Most licenses require the license be put at the top of the file. The license will also be in the repo in a file called License.

But you really don’t need it. In Python, it takes all of five lines of code to use MQTT with the Paho library. Java won’t be much more.