Discover a new way of working with Java that emphasizes innovation over coding. It promotes reuse and a rapid development approach so your teams spend more time innovating. Watch a video of this presentation: http://bit.ly/InnovationOverCoding
Key points:
Introduce the meetup, duration and Q&A at the end
Introduce yourself and your professional background
Mention social media channels and hash tag they can use during the presentation to tweet your thoughts
Key message: Introduce the meetup with good hype and make everyone curious about what they are about to learn/see.
Key points:
Introduce the meetup, duration and Q&A at the end
Introduce yourself and your professional background
Mention social media channels and hash tag they can use during the presentation to tweet your thoughts
Key message: Introduce the meetup with good hype and make everyone curious about what they are about to learn/see.
How often have you written raw Java (imperative Java) connectivity code like this. To connect to a JDBC database or an AMQP resource such as RabbitMQ? If you are anything like me, then more times than you can count, no doubt. I used to spend hours writing and debugging and optimising such code for every project I worked on. Even though frameworks like Spring provide an abstraction over the need to program directly with the underlying packages, the repetitive nature of such work was unavoidable.
Hello, my name is Alex Theedom I am a Java developer, architect and champion who now works exclusively with technology that minimises to almost nothing zero the effort required to write connectivity logic, freeing up time to focus on the more challenging and interesting work of innovation.
In this short video I will introduce you to connectors, a technology used as part of the MuleSoft rapid development approach that simplifies the development of connectivity code and promotes its reuse throughout your developer teams. In just under 15 mins I will code a connector that encapsulates the connectivity logic for the Amazon Polly service and make it available for reuse by other developers and use it in a simple example API.
Are you ready, well let's get started.
Key message: A connector is a reusable library of Java code that encapsulates connectivity to another system
First of all, what is a connector?. Conceptually, it’s a library of code that encapsulates connectivity to another system. That may be a Database, such as MongoDB, as shown here in the diagram, a File System, or a cloud Cloud Service, such as Amazon’s S3. They are written in Java using the Custom Connector SDK, an annotation based Java framework, provided by MuleSoft. The connector is published to a central repository called Exchange, which is back by Maven, and then becomes available to all developers within your organization. Those developers are now free to reuse the connector in their applications and APIs without having to recode the connectivity logic. The use of the connector is made easy by the way the connector framework auto generates a GUI that allows for the configuration of the connectors security details and configuration options. In fact, the developer does not need to be an expert in the underlying system to be able to reuse it, meaning he or she can spend more time innovating than writing the same connectivity logic over and over again.
Lead out: Now let's have a look at how a connector is used in an API to connector to a Amazon cloud service.
Library of code that encapsulates connectivity to another system
Database (MongoDB), File System (SFTP), Cloud Service (AWS S3)
Many connectors have already been written
By MuleSoft, By Partners and by the community
For key business systems (Salesforce, SAP, and Oracle and 100’s more)
Written in Java using the Custom Connector SDK
an annotation based Java framework for construction of connectors
Connector framework generates a GUI that allows for easy configuration of connector
Security details, configuration options
Great opportunity to write contribute to the thriving MuleSoft open source connectors
MuleSoft Community Connectors
Lead out: Now let's have a look at how to code a customer connector in Java. One of my favorite AWS services is the Amazon polly service, which converts text to voice. You provide it with a string of text and it generates a sound file of those words spoken from a choice of different voices and languages.
Key message: Connector is a building block that facilitates integration of external services in an application
Now, one of my favorite AWS services is the Amazon polly service, this service converts text to voice. The way it works is that you provide it with a string of text and it generates an MP3 of those words, spoken from a choice of voices and languages.
So you can imagine how this service can add some really innovative features to your applications. It's the kind of functionality that once added to one application you are going to get demand to add it to many more. Typically, this means writing the same connectivity logic to connect to the AWS service for each application that requires it, and even though AWS provides an SDK to facilitate coding, it can become repetitive very soon.
This is where the connector comes into play. Imagine you have a connector that encapsulates the connectivity logic for establishing a connection, instantiating instances of voice and manages the interaction between your application and the Amazon Polly service. And imagine that you only have to code it once, because it becomes discovable and reusable throughout your organization, without any further involvement from yourself. What does this mean for you, what this means is that you are now freed to move on to new projects, new innovations, you are not stuck writing the same logic over and over again. For your organisation this means, they can leverage your skill and talent as a developer on innovations rather than on plumbing and integration code.
This is what connectors and the MuleSoft rapid development approach is all about.
In the diagram, you can see an HTTP request made to an API built using the MuleSoft visual application development tool. The application has a fully configured Amazon Polly Connector, in which Java connectivity logic is encapsulated. Text is passed to the service and a synthesized speech MP3 is returned to the API which it then passes in the body response to the original HTTP request.
Here you have a perfect example of to use and reuse a connector to add a text to speech feature to your application.
Lead out: Lets learn a little more about the Amazon Polly service before I should how to code a connector.
Key Message: To explain the Polly service and show that it consists of two parts: Configuration and connectivity logic
Amazon Polly is a cloud service capable of synthesising text into human-like speech in male and female voices and multiple languages. It includes Neural Text-to-Speech voices, that delivers improvements in speech quality through machine learning approaches, offering the most natural and lifelike voices possible.
Typical use cases for Amazon Polly include, but are not limited to, speech-enabled mobile applications such as newsreaders, games, eLearning platforms, accessibility applications for visually impaired people, and the rapidly growing segment of IoT.
When developing with the Polly service consider that it consists of two aspects. The first provides the service configuration, such as the voice and generation engine, and the logic for instantiating an instance of the service, the second invokes the service with the text and preconfigured service instance. This second aspect requests the text sythisation from the cloud service.
Lead out: Now let's dive a little deeper and understand what the configuration details are before coding the connector.
Key message: These are the configurations required by the service
The Amazon Polly service requires minimal configuration. The voice configuration is the name of the voice and is mapped to a language and gender. Currently, there are 64 voices in 29 languages and accents. The engine determines if the voice should be generated in conversational or newsreader style. And final the AWS region and the access and secret keys.
https://docs.aws.amazon.com/polly/
Lead out: Now let's have a look at how to code the connector and the classes it requires.
Key message: These are the parts that make up the
The first aspect of the Amazon Polly service connector I will developer is the connection provider. This provides the voice, engine, access key, access secret and the AWS region configuration. The connection provider is used by the Connector Connection to instantiate an instance of the Polly service and Voice. This concludes the Service Configuration Connectivity Logic and Instantiation aspect.
The second aspect I will developer is the Connector operations.This invokes the preconfigured Polly service instance with the text to synthesize. The connector operation passes to the Polly service the text provided by a query parameter in an HTTP request,, and responses with an MP3 of the synthesized text.
Lead out: Now that we know the Polly service well and how to develop a connector in theory, let's take a look at how to actually code a customer connector in Java.
Key message: A class is translated by Anypoint studio into a GUI into which connection configurations are set
Not need for the developer of the mule application to write connectivity logic
This logic is taken care of in the ConnectionProvider class
Let’s review.
The MuleSoft connector SDK provides a framework for the creation of custom connectors that translates Java code into easy to use graphical user interfaces.
For example, we have seen how the ConnectionProvider class acts as a template for the connector configuration interface. In our Amazon Polly connector, it provides a place to set the AWS keys and region, the voice and engine. There is no need for the MuleSoft developer to code connectivity logic because the Java developer has already provided this via the connector configuration.
Key message: A class is translated by Anypoint studio into a GUI into which connection configurations are set
Not need for the developer of the mule application to write connectivity logic
This logic is taken care of in the ConnectionProvider class
Let’s review.
The MuleSoft connector SDK provides a framework for the creation of custom connectors that translates Java code into easy to use graphical user interfaces.
For example, we have seen how the ConnectionProvider class acts as a template for the connector configuration interface. In our Amazon Polly connector, it provides a place to set the AWS keys and region, the voice and engine. There is no need for the MuleSoft developer to code connectivity logic because the Java developer has already provided this via the connector configuration.
Key message: Another class into which specific use case configurations are set, in this case the text to vocalise, langage and name of the voice, this is translated into a GUI by Studio
Once the connector has been configured the MuleSoft developer configures an instance of the Amazon Polly connector with the text to synthise. The AmazonPollyConnectorOperations class that provides the service invocation and returns the synthesized voice as an MP3 file to the Mule application which in turn packages up as in the body response to the original HTTP request.
GitHUb Repo: https://github.com/atheedom/AWS-Polly-Custom-Connector
Key Message: Sign up today to the self-paced course.
Everyone needs to start its journey enrolling for the free class.
CTA! Call to Action, the audience should go and enroll themselves into the training platform. So give them "orders"/directions, be kind but don't leave up to them the decision.
Send this link in the chat window: https://training.mulesoft.com/site/signup.do?utm_source=level-2-presentation&utm_medium=end-of-meetup&utm_campaign=3rd-party-meetup&utm_term=Free-signup
Also show the signup process and log into the course and show the course.
Content creator notes: The QR codes used during this presentation were created with https://www.qrcode-monkey.com/
Key points:
Introduce the meetup, duration and Q&A at the end
Introduce yourself and your professional background
Mention social media channels and hash tag they can use during the presentation to tweet your thoughts
Key message: Introduce the meetup with good hype and make everyone curious about what they are about to learn/see.