Demonstration Scenario
Environment Setup
- Add a host entry to the host machine
docker-machine start
- will start the docker machine if you are usingwindows
orOSx
.docker-machine ip
- will display the IP address of the docker machine.- Open the
hosts
file of the host machine, and add an entry as<ip-address> docker.machine
.
- Download WSO2 product binary packages
- WSO2 API Manager 1.10.0 -
wso2am-1.10.0.zip
- WSO2 Data Analytics Server 3.0.1 -
wso2das-3.0.1.zip
- WSO2 Data Services Server 3.5.0 -
wso2dss-3.5.0.zip
- WSO2 Enterprise Service Bus 4.9.0 -
wso2esb-4.9.0.zip
- WSO2 API Manager 1.10.0 -
- Add these 4 binary packs to the
packs
directory.
Demostration Setup Overview
WSO2 Data Services Server (DSS)
- Start the DSS container
docker-compose up -d dbs
- will create the container image and boot it up.docker-compose up -d dss
- will create the DSS container image and boot it up.docker ps
- lists the running container information.- Observe the NAME values ( dss.dbtoapi.com , dbs.dbtoapi.com ) of the containers.
- Upload Artifacts
- Tail DSS logs, and observe.
- Run
docker exec -it dss.dbtoapi.com tailf wso2/wso2dss-3.5.0/repository/logs/wso2carbon.log
- Run
- Open the admin management console with https://docker.machine:9445/carbon (user=admin, password=admin).
- Go to
Manage > Carbon Applications > Add
. - Upload
artifacts/data-to-api-composite-project_1.0.0.car
. - Observe DSS logs and verify that the artifacts were deployed successfully.
- Tail DSS logs, and observe.
- Open SOAPUI, and load project
artifacts/data-to-api-soapui-project-soapui-project.xml
. - Observe operations of the two Data Services.
- CourseInformationDataService
- Try the operations
getEnrollments
: andgetEnrollmentsBySubject
with5242GW
assubjectCode
.
- Try the operations
- StudentInformationDataService
- Try the operations
getStudents
: andgetStudentById
with02341334
asstudentId
.
- Try the operations
- CourseInformationDataService
WSO2 Enterprise Service Bus (ESB)
- Start the ESB container
docker-compose up -d esb
- will create the ESB container image and boot it up.docker ps
- lists the running containers information.- Observe the NAME value ( esb.dbtoapi.com ) of this container.
- Upload Artifacts
- Tail ESB logs, and observe.
- Run
docker exec -it esb.dbtoapi.com tailf wso2/wso2esb-4.9.0/repository/logs/wso2carbon.log
- Run
- Open the admin management console with https://docker.machine:9444/carbon (user=admin, password=admin).
- Go to
Manage > Carbon Applications > Add
. - Upload
artifacts/data-to-api-composite-project_1.0.0.car
. - Observe ESB logs and verify that the artifacts were deployed successfully.
- Tail ESB logs, and observe.
- Start a REST client like POSTMAN
- Add
http://docker.machine:8281/registrations/enrollments/<an existing subject code>
- i.e.
http://docker.machine:8281/registrations/enrollments/5242GW
- i.e.
- Invoke and observe the response
- Add header
Accept
with valueapplication/json
- Invoke and observe the response and ESB logs
- Add header
Accept
with valueapplication/xml
- Invoke and observe the response and ESB logs
WSO2 API Manager (API-M)
- Start the API-M container
docker-compose up -d apim
- will create the API-M and WSO2 Data Analytics Server(DAS) container images and boot them up.docker ps
- lists the running containers information.- Observe the NAME values ( api.dbtoapi.com, das.dbtoapi.com ) of this container.
- Open API-M user interfaces (user=admin, password=admin).
- API-M Admin Console https://docker.machine:9443/carbon
- API-M Publisher https://docker.machine:9443/publisher
- API-M Store https://docker.machine:9443/store
- Publish the API which was created on the ESB earlier.
- Create an API on API-M publisher.
- Provide a proper resource path (i.e.
/registrarapi
) - Add resource
/enrollments/{subjectCode}
with GET method. - Provide
http://esb.dbtoapi.com:8280/registrations
as the production URL- In this case, communication happens directly between the API-M and ESB docker containers.
- It does not happen accross the host machine.
- Therefore, instead of using
docker.machine
as the hostname to contact the ESB, - it is neccessary to use the ESB container name
esb.dbtoapi.com
as host name. - When the host machine doesn't involve in communication, the docker-compose port mappings do not apply.
- Therefore, instead of using port '8281', directly use port '8280' (ignoring the port mapping).
- Subscribe to the API via the API-M Store.
- Try the API with Swagger based API Console on the API-M Store UI.
- Or, use a REST client like POSTMAN
- i.e.
http://docker.machine:8280/registrarapi/1.0.0/enrollments/5242GW
- i.e.
Additionally note You can also expose the Data Services endpoints (both SOAP and REST) directly through the API Manager, without making a route through the ESB installation.
When You are done...
- Run
docker stop $(docker ps -a -q)
to stop all containers. - Run
docker-machine stop
to stop the machine.