spring-xd-1.0.0.M6 を使用しています。
Spring-xd のシンクとして mysql DB を構成しようとしています
私は従う - http://theblasfrompas.blogspot.in/2014/01/springxd-filetail-input-ingestion-jdbc.html
jdbc.properties ファイルを入れました -
1)spring-xd-1.0.0.M6/xd/modules/sink/jdbc/config
場所
2) mysql コネクタ jar を
spring-xd-1.0.0.M6/xd/lib
ファイル-input.txtを作成し、フォルダーに入れます-/<some path>/temp/input.txt
ファイルには
{"id":"1","name":"pas"}
{"id":"2","name":"lucia"}
{"id":"3","name":"lucas"}
{"id":"4","name":"siena"}
jdbc ファイルには、次の情報が含まれています。
driverClass=com.mysql.jdbc.Driver
url=jdbc:mysql://127.0.0.1:3306/spring_xd
username=root
password=root
XDシェルで次のように実行します
stream create --name filetest --definition "tail --name='/<some path>/temp/input.txt' | jdbc --columns='id,name'" --deploy
私のmysql DBテーブル名は-file_testで、idとnameの2つの列があります-で述べたのと同じですExample Link
しかし、私は得る
Command failed org.springframework.xd.rest.client.impl.SpringXDException: Error with option(s) for module jdbc of type sink:
columns: option named 'columns' is not supported
tableName パラメータを指定すると、..
tableName: option named 'tableName' is not supported
私も参照しています - https://github.com/spring-projects/spring-xd/pull/621
しかし、手がかりは少ない....最新のSpring-xdビルド