Twilio Spring Boot Auto-Configure


License

License

Categories

Categories

Spring Boot Container Microservices Auto Application Layer Libs Code Generators config Configuration
GroupId

GroupId

io.mateo.spring
ArtifactId

ArtifactId

twilio-spring-boot-autoconfigure
Last Version

Last Version

1.0.0-rc.1
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

Twilio Spring Boot Auto-Configure
Twilio Spring Boot Auto-Configure
Project URL

Project URL

https://github.com/ciscoo/twilio-spring-boot
Source Code Management

Source Code Management

https://github.com/ciscoo/twilio-spring-boot

Download twilio-spring-boot-autoconfigure

Dependencies

compile (1)

Group / Artifact Type Version
com.twilio.sdk : twilio jar 7.42.0

runtime (3)

Group / Artifact Type Version
org.apache.commons : commons-lang3 jar 3.9
org.springframework.boot : spring-boot jar 2.2.2.RELEASE
org.springframework.boot : spring-boot-autoconfigure jar 2.2.2.RELEASE

Project Modules

There are no modules declared in this project.

Twilio Spring Boot

Twilio Spring Boot makes it easy to initialize the Twilio Java SDK using the same Spring Boot configuration idioms you are already used to.

Installation

Gradle

dependencies {
    implementation("io.mateo:twilio-spring-boot-starter:1.0.0")
}
ℹ️

Use the compile configuration for older versions of Gradle.

Maven

<dependencies>
    <dependency>
        <groupId>io.mateo</groupId>
        <artifactId>twilio-spring-boot-starter</artifactId>
        <version>1.0.0</version>
    </dependency>
</dependencies>

Configuration

Configure your Twilio credentials using the following:

Never hardcode your Twilio credentials: https://twil.io/secure
application.properties
twilio.credentials.account-sid=${TWILIO_ACCOUNT_SID}
twilio.credentails.auth-token=${TWILIO_AUTH_TOKEN}
application.yml
twilio:
  credentials:
    account-sid: ${TWILIO_ACCOUNT_SID}
    auth-token: ${TWILIO_AUTH_TOKEN}

If you need to override Twilio’s TwilioRestClient or ListeningExecutorService then simply provide beans of those types:

MyConfiguration.java
import com.google.common.util.concurrent.ListeningExecutorService;
import com.twilio.http.TwilioRestClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
public class MyConfiguration {

    @Bean
    public TwilioRestClient twilioRestClient() {
        // ...
    }

    @Bean
    public ListeningExecutorService listeningExecutorService() {
        // ...
    }
}

Twilio Spring Boot automatically looks for those beans and apply them if they are present.

Versions

Version
1.0.0-rc.1