Using Consul client in Android app

437 views
Skip to first unread message

ukum...@gmail.com

unread,
Dec 12, 2015, 8:37:19 AM12/12/15
to Consul
Hello all,

I am trying to use Consul in our local network.

Consul agent is running on one Windows PC. Using Microphone (.Net package) to register few services.

And trying to implement an android client using Consul. But not sure if it's really possible. Thinking of using some consul java consul clients but not sue if that works or not.

Does anybody already implemented anything like this? Or any suggestions?

Thanks,
Upendra

Armon Dadgar

unread,
Dec 14, 2015, 3:09:31 PM12/14/15
to consu...@googlegroups.com, ukum...@gmail.com
Hey Upendra,

You should be able to use the Java clients, as the clients are largely just wrappers
around an HTTP client anyways. Do you mean to just talk to a Consul agent via the
API, or are you planning on actually running Consul on the Android device?

In the case of consuming the API, that should be fine, nothing special about Android.
Otherwise, if you try to run Consul on the phone you may have some issues given
the assumptions about networking (low latency between clients on the LAN).

Best Regards,
Armon Dadgar
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/consul/issues
IRC: #consul on Freenode
---
You received this message because you are subscribed to the Google Groups "Consul" group.
To unsubscribe from this group and stop receiving emails from it, send an email to consul-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/consul-tool/53aa2d10-e23a-4723-b048-a78a07d4d79f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Upendra Kumbham

unread,
Dec 14, 2015, 3:46:23 PM12/14/15
to Armon Dadgar, consu...@googlegroups.com
Hello Armon,

Thanks for replying.

As per my understanding to use HTTP API, I should know where consul agent is running (host name), otherwise I don't think I can connect using HTTP API.

And coming to consul, I am assuming by running consul client on Android device (or any other device) it would detect consult agent(server) in local environment. But it seems like I completely misunderstood how it works.

I am sure you will be busy, but if you can respond that would help me.

Thanks.
--
Regards,
Upendra

Armon Dadgar

unread,
Dec 14, 2015, 3:50:03 PM12/14/15
to Upendra Kumbham, consu...@googlegroups.com
Upendra,

It would probably not be productive to try to run the Consul agent on the Android device,
but if you know the address of any agent running Consul, you shouldn’t have any issues
using an API client.

Hope that helps!

Best Regards,
Armon Dadgar

Upendra Kumbham

unread,
Dec 14, 2015, 4:07:24 PM12/14/15
to Armon Dadgar, consu...@googlegroups.com
Thanks again for replying.

Can you please confirm the following?

If there is a consul agent (server) running on local network, is there any way it can be discovered by other clients without knowing the host name?

Thanks.
--
Regards,
Upendra

James Phillips

unread,
Dec 14, 2015, 4:14:50 PM12/14/15
to consu...@googlegroups.com, Armon Dadgar
Hi Upendra,

Since running the Consul client isn't a good option on Android, the best thing is probably to use DNS and give the record the addresses of your Consul servers (or any other machines running the Consul agent that you want your mobile clients to contact).

-- James

Reply all
Reply to author
Forward
0 new messages