In order to be able to run the demo you first need to start the docker containers from the docker-compose file.
Then you can run application by starting CamelDemoApplication from the IDE or with maven:
docker-compose up -d mvn clean package spring-boot:run
A scenario something like the one below will play out… it changes as I add new demo’s but you’ll get the drift:
2017-04-13 22:11:25.048 INFO 5473 --- [/startingPoint/] SimpleFileCopyRoute : Found file [HelloWorld.txt] and copying it to: /Users/ivonet/dev/camel-demo/test-data/SimpleJmsRoute/ 2017-04-13 22:11:25.192 INFO 5473 --- [SimpleJmsRoute]] nl.ivonet.route.jms.SimpleJmsRoute : Hello, world! 2017-04-13 22:11:25.666 INFO 5473 --- [localhost:11021] FtpToFtpRoute : Found file [HelloWorld.txt] and cp-ing it to the ftp user: user 2017-04-13 22:11:26.169 INFO 5473 --- [localhost:11021] FtpToFileRoute : Found file [HelloWorld.txt] and copying it to: /Users/ivonet/dev/camel-demo/target/
The whole idea of the above thing is to play around with routes as to get familiar with it.
The scenario above is outdated because lots more has been implemented but it is a good place to start. Just follow the routes further and you will see it all happening…
The docker-compose.yml file in this project has been tuned to work for this camel-demo project. So some volumes have been mounted with a specific goal.
Start:
docker-compose up [-d]
the -d option will start in daemon mode
Stop:
docker-compose down [-v]
the -v option will also remove the docker volumes created. You can do this any time you want. It might even be preferable in this project as you can then see everything happening from the beginning state.
In order to demo the ftp routes in this project an ftp server has been configured in the docker-compose file. This ftp server mounts ‘native local’ folders in the test-data/ftp folder but it will also actually enable the ftp protocol. So the FtpTo*Routes really talk ftp in the demo.
You will be able to see what happens on your native file system though. Please look at the ftp config in the docker-compose file to see how that works.
This project has two users pre-configured:
Their home folders reside in test-data/ftp and the users have been saved in docker/ftp/passwd/pureftpd.passwd file as described below.
You can add your own user(s) if you want to play:
First you need to start the ivonet/ftp docker container:
docker run --rm --name ftp \ -v $(pwd)/docker/ftp/passwd:/etc/pure-ftpd/passwd \ -v $(pwd)/target/ftpusers:/home/ftpusers/ \ -p 11021:21 \ -p 30000-30009:30000-30009 \ ivonet/ftp
Then you need to enter the running image:
docker exec -it ftp /bin/bash pure-pw useradd USERHERE \ -f /etc/pure-ftpd/passwd/pureftpd.passwd \ -m -u ftpuser \ -d /home/ftpusers/USERHERE
Exit the image with logout and stop the image with ctrl-c or
docker stop ftp