Links
Comment on page

Application Configuration

Grainite applications are configured by providing a YAML file. Here is an example of a sample application:
app_name: payments
package_id: org.grainite.samples
topics:
- topic_name: transactions_topic
key_name: serviceId
key_type: string
value_type: string
- topic_name: canonical_transactions_topic
key_name: transactionId
key_type: string
value_type: string
tables:
- table_name: incoming_transactions_table
key_type: string
value_type: long
action_classes:
- name: IncomingTransactionsHandler
class_name: org.grainite.samples.IncomingTransactionsHandler
actions:
- action_name: handleTimerRequest
- action_name: yetAnotherHandler
- name: ExternalClientsHandler
class_name: org.grainite.samples.ExternalClientsHandler
actions:
- action_name: queryEternalClients
- table_name: transactions_table
key_type: string
value_type: string
maps:
- id: 0
name: transaction_history
key_type: string
value_type: string
action_classes:
- class_name: org.grainite.samples.TransactionsHandler
actions:
- action_name: handleTransactions
subscriptions:
- subscription_name: transactionUpdates
topic_name: transactions_topic
topic_key: serviceId
Head over to the Configuration Options page to get detailed information about the YAML configuration file.