This post will show you how to integrate service discovery and intelligent routing into a Node.js application built with a microservices architecture. You'll see how you can do this with two Netflix open source projects, Eureka and Zuul, that run in the Java SE Runtime Environment.
The Netflix Eureka server provides service discovery. This gives your application's services the ability to find other services without knowing where they are hosted or the full URL required to reach them, so you don't have to provide complete ...
Using WhatsApp, Twilio and Azure to Generate Photo Alt-text in Java
AI services like Computer Vision (CV) are getting easier and easier to play with, and we can have some fun by making them available to use from our cellphones. In this post, we will use Java to connect the Twilio API for WhatsApp with Azure’s CV APIs to create a bot that can describe photos. It would be neat to use this for generating alt-text to help make your images more accessible online, for example.
We will need the following to get started with this post
- Java 8 or higher
- A Twilio Account
- An Azure account and Cognitive Services subscription key
Overview of our app
How it works
When Twilio receives a WhatsApp message it will send an HTTP request to a URL we provide.
Our mission is to create an app in Java which can handle those requests. The app will take the URL of any ...
Introducing Developer Evangelist Matthew Gilliard
When I was a young kid we used to take family holidays from the UK to France. I remember meeting other kids on holiday with their families for a week at a time, spending time playing with them and having loads of fun.
These other kids were from exotic-sounding places like Germany and France. Despite enjoying the same kinds of games and having loads of fun together we didn’t speak the same language and could never have a conversation. As children we had a lot in common but our lives and toys and everything were so different.
Since that time I always wanted to travel - to meet people and see what life is like in different places - how it is similar and how it is different.
Living and Working Abroad
I was very shy of public speaking when I was young. After two years of working as a programmer ...
How to Send WhatsApp Messages from Java Applications with Twilio
WhatsApp is a global messaging service that helps billions of people communicate with each other. Applications can now also programmatically interact with people on the service using the Twilio Messaging API and Twilio's Java Helper Library. Let's learn how to quickly send messages to people from a new or existing Java application.
Our local development environment needs the following dependencies to properly send WhatsApp messages from Java.
- Java SE version 7 or higher
- A free Twilio account with an activated WhatsApp Sandbox
- The Twilio Java Helper Library
First, install Java on your development machine if you do not already have it. You can also read this detailed tutorial on setting up your Java development environment if you are having trouble.
Take note of your Account SID and Auth Token when you log ...
How to Call the Twilio API from Java Programs on the Commandline
If you you need to do a quick Twilio test, or compile and run programs on a remote computer without any GUI, or run test programs on your own computer and you don’t want to use a full blown IDE development environment, this is the article for you.
Check Java Installation
Confirm that you have a Java runtime environment (JRE) on your computer for running Java class files:
$ java -version java version "1.8.0_131"<br/>Java(TM) SE Runtime Environment (build 1.8.0_131-b11)<br/>Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode) Check that you have the Java compiler on your computer: $ javac Usage: javac <options> <source files> ...
If you don’t have both, please go to Oracle’s Java SE page and download the Java JDK.
The Java Standard Edition (Java SE) is what you need for developing ...
Cloud Orchestration, Lazarus and Interning at Twilio
There are a few technical interview strategies everyone knows: communicate your thoughts, give yourself time to think, and keep calm. Absent among these, of course, is coming up entirely blank for a question. So when in the interview for an engineering internship my manager asked, “What experience do you have with distributed systems?” I took a deep breath and, cringing a little, replied, “None, yet. But I’m smart and I learn fast, and I’m interested to learn by working in one.” This was true. I’d been curious about the subject for a while, and figuring it wouldn’t hurt to try, had worked up the courage to apply to a role for which I didn’t hit every “ideal qualification” checkbox. (Take that, tech gender gap!) And to my surprise and relief, I moved forward – all the way to San Francisco, to a spot on Twilio’s ...
Round up: Libraries for checking Pwned Passwords in your 7 favorite languages
Earlier this year Troy Hunt released version 2 of his popular Pwned Passwords API service. The new version comes with even more compromised passwords and a more secure way to query the password API that doesn’t require sending plain text passwords over the network.
The API update comes at a good time. When NIST updated its password guidelines in 2016, it included a new recommendation to check “memorized secret verifiers”, or passwords, against known data breaches:
When processing requests to establish and change memorized secrets, verifiers SHALL compare the prospective secrets against a list that contains values known to be commonly-used, expected, or compromised. For example, the list MAY include, but is not limited to passwords obtained from previous breach corpuses.
Since the API release, the community has created API wrappers in many of our favorite programming languages. In this post, I round up the libraries in 7 languages ...
Add Twilio Programmable Chat to a Java Struts 2 Web App
The need for real-time chat can’t be overemphasized. Real-time communication with your users increases customer satisfaction, and as a result, makes your business more credible.
In this article, I’ll walk you through setting up a Java Struts 2 application. Then we’ll add real-time chat to the application by leveraging Twilio Programmable Chat.
By the end of this tutorial, you’ll have built an application similar to this:
The following are used in this post:
- Java SDK– Download and install the Java SDK from Oracle’s site, if you don’t have it already. (I’m using version 9.0.1)
- Eclipse IDE – Download and install Eclipse from their website. (I’m using Oxygen.1a Release (4.7.1a))
- Maven (The most recent version of Eclipse includes Maven already)
Step 1: Set up Twilio Programmable Chat
First, we need to set up Twilio Chat ...
SOLID Principles in Action: From Slack to Twilio
It seems like there’s a RESTful API for everything these days. From payments to booking tables, from notifications to spinning up virtual machines, you can do almost anything with a simple HTTP interaction.
If you’re building a service of your own, you’ll often want to be able to use it on multiple platforms at once. Following time-tested OOD (object oriented design) principles makes your code more resilient and more easily extended.
In this post, we examine one particular design approach called SOLID (it’s an acronym). We put it to practical use in writing a service that’s a Slack integration and then extending it for use with Twilio.
The service sends you a random Magic the Gathering card. If you’d like to see it in action right away, you can text the word magic to: 1-929-236-9306 (U.S. and Canada only – you’ll get an ...
Verify Phone Numbers with Java and the Twilio Lookup API
Twilio Lookup is a simple REST API for obtaining information about a phone number. Lookup can determine if a number exists, its type (landline, mobile, VoIP), and its carrier (Verizon, Sprint, etc) association. Lookup can also check if a number is able to receive text messages as well as format numbers into a standard format.
Let’s validate phone numbers using the Twilio Java library and the Lookup API and make the code easy to port into your existing Java applications. This post will be directed towards macOS and Linux users, as some of the commands will not work for Windows users.
If you just want to see the finished code, see this Github repository.
Configuring Our Environment