I can not use the
MQTTUtils.createPairedStream()
in Scala?
How to specify list of topics as parameters? I tried all the ways like dictionary, list,tuples, but it did not worked. And then i tried in python, at that time it shows an error like
Java gateway process exited before sending the driver its port number
Scala is a statically-typed language where the arguments you provide to a method must have specific types in order for the method call to compile. Sometimes methods are overloaded, in which case different combinations of arguments can be provided, and in Scala sometimes some arguments may have default values, in which case they don't need to be provided at all.
There are several ways to determine what arguments are possible for a given method. Your IDE might show a tool-tip when you type
MQTTUtils.createPairedStream(
. Sometimes library developers publish API documentation that shows method signatures (which include the argument types and return value) in an easy-to-read format. If neither of these are options for you and the project is open source, you can just look up the source code. In this case you'll find something the following (note that you may need to change the tag in the GitHub interface if you're using a different version):This is the simplest of eight
createPairedStream
method overloads (all the rest take additional arguments). This shows that you'll need to provide (in order) aStreamingContext
, a broker URL, and an array of topics.