Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
Import Process
Text File Validation
Commits
11e66118
Commit
11e66118
authored
Apr 27, 2020
by
Jonas Waeber
Browse files
Update README.md
parent
da08faa1
Pipeline
#8482
failed with stages
in 1 minute and 24 seconds
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
README.md
View file @
11e66118
...
@@ -12,27 +12,23 @@ Checks the files present in the `app.directory` folder on the sFTP server.
...
@@ -12,27 +12,23 @@ Checks the files present in the `app.directory` folder on the sFTP server.
### Requirements
### Requirements
-
Execute command
`./gradlew addKtlintFormatGitPreCommitHook`
-
Execute command
`./gradlew addKtlintFormatGitPreCommitHook`
-
Access to a Kafka Server
-
Access to a SFTP Server
-
Set environment variable $SFTP_PASSWORD
-
Set environment variable $HOST_KEY_VERIFIER (fingerprint is posted in the logs when running the connection for the first time.)
### Configuration
### Configuration
```
yaml
```
yaml
sftp
:
sftp
:
host
:
<host-name>
host
:
localhost
port
:
"
22"
port
:
22000
user
:
<user-name>
user
:
user
password
:
${SFTP_PASSWORD:?nopass}
password
:
password
fingerprint
:
${HOST_KEY_VERIFIER:?nofinger}
app
:
app
:
directory
:
.
/test_institution_1/test_record_set_1
directory
:
/memobase
/test_institution_1/test_record_set_1
kafka
:
kafka
:
producer
:
producer
:
bootstrap.servers
:
localhost:
9092
bootstrap.servers
:
localhost:
12345
client.id
:
sftp-reader-p1-j1
client.id
:
sftp-reader-p1-j1
value.serializer
:
"
org.apache.kafka.common.serialization.StringSerializer"
topic
:
topic
:
out
:
process-1-job-1-
sftp-reader
out
:
sftp-reader
-p1-j1
```
```
src/main/kotlin/Producer.kt
View file @
11e66118
...
@@ -35,7 +35,6 @@ class Producer(props: Properties, private val topic: String) : Closeable {
...
@@ -35,7 +35,6 @@ class Producer(props: Properties, private val topic: String) : Closeable {
fun
sendMessage
(
key
:
String
,
message
:
String
,
format
:
String
)
{
fun
sendMessage
(
key
:
String
,
message
:
String
,
format
:
String
)
{
log
.
info
(
"Sending message $message to $topic."
)
log
.
info
(
"Sending message $message to $topic."
)
instance
.
send
(
ProducerRecord
(
topic
,
key
,
JsonObject
(
mapOf
(
Pair
(
"path"
,
message
),
Pair
(
"format"
,
format
))).
toJsonString
()))
instance
.
send
(
ProducerRecord
(
topic
,
key
,
JsonObject
(
mapOf
(
Pair
(
"path"
,
message
),
Pair
(
"format"
,
format
))).
toJsonString
()))
count
+=
1
count
+=
1
}
}
...
@@ -46,7 +45,6 @@ class Producer(props: Properties, private val topic: String) : Closeable {
...
@@ -46,7 +45,6 @@ class Producer(props: Properties, private val topic: String) : Closeable {
override
fun
close
()
{
override
fun
close
()
{
instance
.
flush
()
instance
.
flush
()
// TODO: Add report for messages sent count.
// TODO: Add report for messages sent count.
instance
.
close
()
instance
.
close
()
}
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment