public class BigQueryFileMessageHandler
extends org.springframework.integration.handler.AbstractReplyProducingMessageHandler
MessageHandler
which handles sending and
loading files to a BigQuery table.messagingTemplate
EXPRESSION_PARSER, logger
Constructor and Description |
---|
BigQueryFileMessageHandler(BigQueryTemplate bigQueryTemplate) |
Modifier and Type | Method and Description |
---|---|
protected void |
doInit() |
protected Object |
handleRequestMessage(org.springframework.messaging.Message<?> message) |
void |
setFormatOptions(FormatOptions formatOptions)
Sets the handler's
FormatOptions which describe the type/format of data files being
loaded. |
void |
setFormatOptionsExpression(org.springframework.expression.Expression formatOptionsExpression)
Sets the SpEL
Expression used to determine the FormatOptions for the handler. |
void |
setSync(boolean sync)
A
boolean indicating if the BigQueryFileMessageHandler should synchronously
wait for each file to be successfully loaded to BigQuery. |
void |
setTableName(String tableName)
Sets the BigQuery table name to use.
|
void |
setTableNameExpression(org.springframework.expression.Expression tableNameExpression)
Sets the SpEL
Expression to evaluate to determine the table name. |
void |
setTableSchema(Schema schema)
Sets the
Schema of the table to load for the handler. |
void |
setTableSchemaExpression(org.springframework.expression.Expression tableSchemaExpression)
Sets the SpEL expression used to determine the
Schema for the handler. |
void |
setTimeout(Duration timeout)
Sets the
Duration to wait for a file to be loaded into BigQuery before timing out
when waiting synchronously. |
doInvokeAdvisedRequestHandler, getBeanClassLoader, getIntegrationPatternType, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReply
addNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeaders
handleMessage, onComplete, onError, onNext, onSubscribe
buildSendTimer, destroy, getComponentType, getManagedName, getManagedType, getMetricsCaptor, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrack
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public BigQueryFileMessageHandler(BigQueryTemplate bigQueryTemplate)
protected void doInit()
doInit
in class org.springframework.integration.handler.AbstractReplyProducingMessageHandler
public void setTableNameExpression(org.springframework.expression.Expression tableNameExpression)
Expression
to evaluate to determine the table name.tableNameExpression
- the SpEL expression used to evaluate the table namepublic void setTableName(String tableName)
setTableNameExpression(org.springframework.expression.Expression)
.tableName
- name of the BigQuery tablepublic void setFormatOptionsExpression(org.springframework.expression.Expression formatOptionsExpression)
Expression
used to determine the FormatOptions
for the handler.formatOptionsExpression
- the SpEL expression used to evaluate the FormatOptions
public void setFormatOptions(FormatOptions formatOptions)
FormatOptions
which describe the type/format of data files being
loaded. This overwrites any previous settings made by setFormatOptionsExpression(org.springframework.expression.Expression)
.formatOptions
- the format of the data file being loadedpublic void setTableSchemaExpression(org.springframework.expression.Expression tableSchemaExpression)
Schema
for the handler.tableSchemaExpression
- the SpEL expression used to evaluate the Schema
.public void setTableSchema(Schema schema)
Schema
of the table to load for the handler.schema
- the schema of the table to load.public void setTimeout(Duration timeout)
Duration
to wait for a file to be loaded into BigQuery before timing out
when waiting synchronously.timeout
- the Duration
timeout to wait for a file to loadpublic void setSync(boolean sync)
boolean
indicating if the BigQueryFileMessageHandler
should synchronously
wait for each file to be successfully loaded to BigQuery.
If set to true, the handler runs synchronously and returns Job
for message
responses. If set to false, the handler will return
ListenableFuture
of the Job as the response
for each message.
sync
- whether BigQueryFileMessageHandler
should wait synchronously for jobs to
complete. Default is false (async).protected Object handleRequestMessage(org.springframework.messaging.Message<?> message)
handleRequestMessage
in class org.springframework.integration.handler.AbstractReplyProducingMessageHandler
Copyright © 2021. All rights reserved.