SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Batch Message Listener capabilities of the Apache Kafka
Connector
New York MuleSoft Meetup Group
June 25th, 2022
2
▪ Around 14 years of Experience into ERP and Integrations.
▪ Working as Principal Architect @Slalom LLC.
▪ 3X MuleSoft Certified, 1X AWS Certified
▪ Managed multiple End to End Implementations/Integration projects.
▪ Mentoring Mule Developers and People trying to switch to MuleSoft.
Introduction
Neeraj Kumar- Host NYC
Safe Harbor Statement
● Both the speaker and host are organizing this meet up in individual capacity
only. We are not representing our companies here.
● This presentation is strictly for learning purpose only. Organizer/Presenter do
not hold any responsibility that same solution will work for your business
requirements also.
● This presentation is not meant for any promotional activities.
4
Lars Grube
●15 years of IT Software Engineering experience
●Works on business intelligence, data integration and training
solutions
●Specialized in highly parallel processing APIs interacting with
Teradata Vantage
●MuleSoft Certified Developer - Level 1
●LinkedIn profile: https://www.linkedin.com/in/lars-grube
Introductions
5
● Why?
● The overall picture
● The detailed approach
● Live Demo
● Wrap up - Q&A
Agenda
Why?
7
Teradata Vantage is optimized for
parallel bulk inserts
Why?
The overall picture
9
The overall picture
MuleAPI
Batch
Message
Listener
Invalidmessages
Source
system
Publish ApacheKafka
Topic
Partition
Partition
Partition
Teradata Vantage
Targettable
Logtable
ParallelForEach
Bulkinsert
Commit
Success
Failure
Insert
Failure
The detailed approach
11
● Should match approximately
1000 messages
● Should match default fetch
maximum size
● Should be increased if default
fetch minimum size is
frequently missed
● Must be at least as long as
fetch maximum wait timeout,
preferably one minute longer
Configuring the Apache Kafka Consumer
12
● Implement a guard function in order to filter and log messages that
cannot be parsed into the expected format
● Based on: https://blogs.mulesoft.com/dev-guides/how-to-tutorials/guarding-
collections-dataweave-try-function-2/
● Usage
Extracting the payload from the batch message
fun guardWithDefaultOutput (fn, defaultOutput = null) = dw::Runtime::try(fn) match {
case tr if (tr.success) -> tr.result
else -> defaultOutput
}
var payloadValues = (payload.*payload default [] map (value, index) -> do {
var jsonVal = guard(() -> read(value, "application/json"))
---
value: if (jsonVal is Null) null else
{
...
13
● Perform an explicit mapping for all fields to avoid implicit null values
● Segment the payload for parallel processing
● Combine the “Parallel For Each” scope and “Bulk Insert” component
Inserting the data into the database
var payloadValues = (payload.*payload default [] map (value, index) -> do {
...
orderNo: jsonVal.orderNo,
orderDate: jsonVal.orderDate,
customerNo: jsonVal.customerNo,
...
import divideBy as divBy from dw::core::Arrays
---
(vars.batchMessagePayload filter not ($.value is Null)) divBy 100
14
● Define the primary index of the target table on the correlation id and an
ascending number by payload
Inserting the data into the database
CREATE MULTISET TABLE MULE.STG_FACT_ORDERS
(
orderNo BIGINT NOT NULL,
orderDate DATE FORMAT 'YYYY-MM-DD' NOT NULL,
customerNo BIGINT NOT NULL,
itemNo BIGINT NOT NULL,
itemDesc VARCHAR(100) CHARACTER SET UNICODE NOT CASESPECIFIC NOT
NULL,
orderState VARCHAR(30) CHARACTER SET UNICODE NOT CASESPECIFIC NOT
NULL,
lastUpdatedTS TIMESTAMP(3) WITH TIME ZONE NOT NULL,
mule_correlation_id VARCHAR(128) CHARACTER SET UNICODE NOT
CASESPECIFIC NOT NULL,
row_number_by_payload INTEGER NOT NULL)
PRIMARY INDEX ( mule_correlation_id ,row_number_by_payload );
var payloadValues = (payload.*payload default [] map (value, index) -> do {
...
mule_correlation_id: correlationId,
row_number_by_payload: index
}
15
● Use the message attributes (key, creation timestamp, partition, offset) for
precisely logging problematic messages
● Identify irreproducible database issues
● Error type "DB:CONNECTIVITY"
● Error type "MULE:COMPOSITE_ROUTING" containing "DB:CONNECTIVITY"
error or another nested "MULE:COMPOSITE_ROUTING"
● Teradata error codes (2631, 1095, 3134)
● In case of a reproducible database issue occuring during the bulk insert,
split the message array into its items and perform parallel inserts on the
item level
● In case of an irreproducible database issue or any other error, rely on the
default behaviour (redelivery)
Handling errors
(error.errors ++ (flatten(error.errors.*errors) default [])).*errorType.*asString
contains "DB:CONNECTIVITY"
Live Demo
17
● Performance comparison between single and batch message listener
● Handling irreproducible database issues
● Handling and logging problematic message data and reproducible database issues
Live Demo
18
● Teradata Vantage Express on VMWare Workstation Player
https://downloads.teradata.com/download/database/teradata-express-for-vmware-player
https://downloads.vmware.com/d/
● Apache Kafka on Ubuntu
https://kafka.apache.org/
https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-10
● AKHQ
https://akhq.io
● API implementation
https://github.com/larsgrube/teradata-fast-import/tree/master/teradata-import-api
Components overview
Q & A
Quiz Time
Get ready to WIN a Special Gift from MuleSoft Community
21
● Functions for catching and handling DataWeave errors are available in the module dw:: …
a) Core
b) Mule
c) Runtime
d) System
Q1
22
● Which Apache Kafka Consumer configuration parameter should be checked and, if
necessary, increased when increasing the fetch maximum wait timeout?
a) Request timeout
b) Session timeout
c) Maximum polling interval
d) All of the above
Q2
23
● What primary index of a target table should be chosen for parallel bulk inserts?
a) Logical key, correlation id, insert timestamp
b) Correlation id, row number by payload
c) Surrogate key
d) No primary index
Q3
MuleSoft Connect
https://connect.mulesoft.com/event/new-york-city?lang=en
Thank you

Weitere ähnliche Inhalte

Was ist angesagt?

MuleSoft Runtime Fabric (RTF): Foundations : MuleSoft Virtual Muleys Meetups
MuleSoft Runtime Fabric (RTF): Foundations  : MuleSoft Virtual Muleys MeetupsMuleSoft Runtime Fabric (RTF): Foundations  : MuleSoft Virtual Muleys Meetups
MuleSoft Runtime Fabric (RTF): Foundations : MuleSoft Virtual Muleys MeetupsAngel Alberici
 
Introduction to Kong API Gateway
Introduction to Kong API GatewayIntroduction to Kong API Gateway
Introduction to Kong API GatewayYohann Ciurlik
 
MuleSoft Sizing Guidelines - VirtualMuleys
MuleSoft Sizing Guidelines - VirtualMuleysMuleSoft Sizing Guidelines - VirtualMuleys
MuleSoft Sizing Guidelines - VirtualMuleysAngel Alberici
 
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...Manish Kumar Yadav
 
Webinar "Introduction to OpenStack"
Webinar "Introduction to OpenStack"Webinar "Introduction to OpenStack"
Webinar "Introduction to OpenStack"CREATE-NET
 
MuleSoft Deployment Strategies (RTF vs Hybrid vs CloudHub)
MuleSoft Deployment Strategies (RTF vs Hybrid vs CloudHub)MuleSoft Deployment Strategies (RTF vs Hybrid vs CloudHub)
MuleSoft Deployment Strategies (RTF vs Hybrid vs CloudHub)Prashanth Kurimella
 
Integrating Microservices with Apache Camel
Integrating Microservices with Apache CamelIntegrating Microservices with Apache Camel
Integrating Microservices with Apache CamelChristian Posta
 
Anypoint Platform for Pivotal Cloud Foundry
Anypoint Platform for Pivotal Cloud FoundryAnypoint Platform for Pivotal Cloud Foundry
Anypoint Platform for Pivotal Cloud FoundryMuleSoft
 
Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...
Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...
Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...TomBarron
 
Awx user guide
Awx user guideAwx user guide
Awx user guidemspirko
 
Monitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Monitor Apache Spark 3 on Kubernetes using Metrics and PluginsMonitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Monitor Apache Spark 3 on Kubernetes using Metrics and PluginsDatabricks
 
[NEW LAUNCH!] Introducing Amazon Managed Streaming for Kafka (Amazon MSK) (AN...
[NEW LAUNCH!] Introducing Amazon Managed Streaming for Kafka (Amazon MSK) (AN...[NEW LAUNCH!] Introducing Amazon Managed Streaming for Kafka (Amazon MSK) (AN...
[NEW LAUNCH!] Introducing Amazon Managed Streaming for Kafka (Amazon MSK) (AN...Amazon Web Services
 
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트OpenStack Korea Community
 
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...Eva Mave Ng
 
OVN DBs HA with scale test
OVN DBs HA with scale testOVN DBs HA with scale test
OVN DBs HA with scale testAliasgar Ginwala
 
The twelve factor app
The twelve factor appThe twelve factor app
The twelve factor appRavi Okade
 
Object Store V2 Workshop
Object Store V2 WorkshopObject Store V2 Workshop
Object Store V2 WorkshopMuleSoft
 
Rtf v2 ingress muleSoft meetup self managed kubernetes
Rtf v2 ingress muleSoft meetup self managed kubernetesRtf v2 ingress muleSoft meetup self managed kubernetes
Rtf v2 ingress muleSoft meetup self managed kubernetesSandeep Deshmukh
 

Was ist angesagt? (20)

Cloudhub 2.0
Cloudhub 2.0Cloudhub 2.0
Cloudhub 2.0
 
MuleSoft Runtime Fabric (RTF): Foundations : MuleSoft Virtual Muleys Meetups
MuleSoft Runtime Fabric (RTF): Foundations  : MuleSoft Virtual Muleys MeetupsMuleSoft Runtime Fabric (RTF): Foundations  : MuleSoft Virtual Muleys Meetups
MuleSoft Runtime Fabric (RTF): Foundations : MuleSoft Virtual Muleys Meetups
 
Introduction to Kong API Gateway
Introduction to Kong API GatewayIntroduction to Kong API Gateway
Introduction to Kong API Gateway
 
MuleSoft Sizing Guidelines - VirtualMuleys
MuleSoft Sizing Guidelines - VirtualMuleysMuleSoft Sizing Guidelines - VirtualMuleys
MuleSoft Sizing Guidelines - VirtualMuleys
 
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...
 
Webinar "Introduction to OpenStack"
Webinar "Introduction to OpenStack"Webinar "Introduction to OpenStack"
Webinar "Introduction to OpenStack"
 
MuleSoft Deployment Strategies (RTF vs Hybrid vs CloudHub)
MuleSoft Deployment Strategies (RTF vs Hybrid vs CloudHub)MuleSoft Deployment Strategies (RTF vs Hybrid vs CloudHub)
MuleSoft Deployment Strategies (RTF vs Hybrid vs CloudHub)
 
Integrating Microservices with Apache Camel
Integrating Microservices with Apache CamelIntegrating Microservices with Apache Camel
Integrating Microservices with Apache Camel
 
Anypoint Platform for Pivotal Cloud Foundry
Anypoint Platform for Pivotal Cloud FoundryAnypoint Platform for Pivotal Cloud Foundry
Anypoint Platform for Pivotal Cloud Foundry
 
Mule esb presentation
Mule esb presentationMule esb presentation
Mule esb presentation
 
Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...
Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...
Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...
 
Awx user guide
Awx user guideAwx user guide
Awx user guide
 
Monitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Monitor Apache Spark 3 on Kubernetes using Metrics and PluginsMonitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Monitor Apache Spark 3 on Kubernetes using Metrics and Plugins
 
[NEW LAUNCH!] Introducing Amazon Managed Streaming for Kafka (Amazon MSK) (AN...
[NEW LAUNCH!] Introducing Amazon Managed Streaming for Kafka (Amazon MSK) (AN...[NEW LAUNCH!] Introducing Amazon Managed Streaming for Kafka (Amazon MSK) (AN...
[NEW LAUNCH!] Introducing Amazon Managed Streaming for Kafka (Amazon MSK) (AN...
 
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트
 
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
 
OVN DBs HA with scale test
OVN DBs HA with scale testOVN DBs HA with scale test
OVN DBs HA with scale test
 
The twelve factor app
The twelve factor appThe twelve factor app
The twelve factor app
 
Object Store V2 Workshop
Object Store V2 WorkshopObject Store V2 Workshop
Object Store V2 Workshop
 
Rtf v2 ingress muleSoft meetup self managed kubernetes
Rtf v2 ingress muleSoft meetup self managed kubernetesRtf v2 ingress muleSoft meetup self managed kubernetes
Rtf v2 ingress muleSoft meetup self managed kubernetes
 

Ähnlich wie Batch Message Listener capabilities of the Apache Kafka Connector

PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...
PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...
PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...AMD Developer Central
 
9\9 SSIS 2008R2_Training - Package Reliability and Package Execution
9\9 SSIS 2008R2_Training - Package Reliability and Package Execution9\9 SSIS 2008R2_Training - Package Reliability and Package Execution
9\9 SSIS 2008R2_Training - Package Reliability and Package ExecutionPramod Singla
 
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-Malla
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-MallaKerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-Malla
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-MallaSpark Summit
 
Better Drupal 8 Batch Services
Better Drupal 8 Batch ServicesBetter Drupal 8 Batch Services
Better Drupal 8 Batch ServicesAaron Crosman
 
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)M Malai
 
Ansible is Our Wishbone
Ansible is Our WishboneAnsible is Our Wishbone
Ansible is Our WishboneMydbops
 
Dataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStoreDataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStoreVikalp Bhalia
 
Declarative Infrastructure Tools
Declarative Infrastructure Tools Declarative Infrastructure Tools
Declarative Infrastructure Tools Yulia Shcherbachova
 
Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Valerii Kravchuk
 
Questions On The Code And Core Module
Questions On The Code And Core ModuleQuestions On The Code And Core Module
Questions On The Code And Core ModuleKatie Gulley
 
PostgreSQL versus MySQL - What Are The Real Differences
PostgreSQL versus MySQL - What Are The Real DifferencesPostgreSQL versus MySQL - What Are The Real Differences
PostgreSQL versus MySQL - What Are The Real DifferencesAll Things Open
 
OSGi Cloud Ecosystems - David Bosschaert
OSGi Cloud Ecosystems - David BosschaertOSGi Cloud Ecosystems - David Bosschaert
OSGi Cloud Ecosystems - David Bosschaertmfrancis
 
Database & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdf
Database & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdfDatabase & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdf
Database & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdfInSync2011
 
Endofday: A Container Workflow Engine for Scalable, Reproducible Computation
Endofday: A Container Workflow Engine for Scalable, Reproducible ComputationEndofday: A Container Workflow Engine for Scalable, Reproducible Computation
Endofday: A Container Workflow Engine for Scalable, Reproducible ComputationEnis Afgan
 
Apache Spark: What? Why? When?
Apache Spark: What? Why? When?Apache Spark: What? Why? When?
Apache Spark: What? Why? When?Massimo Schenone
 
Architecting and productionising data science applications at scale
Architecting and productionising data science applications at scaleArchitecting and productionising data science applications at scale
Architecting and productionising data science applications at scalesamthemonad
 
Camunda BPM 7.2: Performance and Scalability (English)
Camunda BPM 7.2: Performance and Scalability (English)Camunda BPM 7.2: Performance and Scalability (English)
Camunda BPM 7.2: Performance and Scalability (English)camunda services GmbH
 

Ähnlich wie Batch Message Listener capabilities of the Apache Kafka Connector (20)

PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...
PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...
PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...
 
Map reduce prashant
Map reduce prashantMap reduce prashant
Map reduce prashant
 
9\9 SSIS 2008R2_Training - Package Reliability and Package Execution
9\9 SSIS 2008R2_Training - Package Reliability and Package Execution9\9 SSIS 2008R2_Training - Package Reliability and Package Execution
9\9 SSIS 2008R2_Training - Package Reliability and Package Execution
 
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-Malla
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-MallaKerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-Malla
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-Malla
 
Richa_Profile
Richa_ProfileRicha_Profile
Richa_Profile
 
Better Drupal 8 Batch Services
Better Drupal 8 Batch ServicesBetter Drupal 8 Batch Services
Better Drupal 8 Batch Services
 
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
 
Ansible is Our Wishbone
Ansible is Our WishboneAnsible is Our Wishbone
Ansible is Our Wishbone
 
Dataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStoreDataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStore
 
Declarative Infrastructure Tools
Declarative Infrastructure Tools Declarative Infrastructure Tools
Declarative Infrastructure Tools
 
Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)
 
Questions On The Code And Core Module
Questions On The Code And Core ModuleQuestions On The Code And Core Module
Questions On The Code And Core Module
 
PostgreSQL versus MySQL - What Are The Real Differences
PostgreSQL versus MySQL - What Are The Real DifferencesPostgreSQL versus MySQL - What Are The Real Differences
PostgreSQL versus MySQL - What Are The Real Differences
 
OSGi Cloud Ecosystems - David Bosschaert
OSGi Cloud Ecosystems - David BosschaertOSGi Cloud Ecosystems - David Bosschaert
OSGi Cloud Ecosystems - David Bosschaert
 
Database & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdf
Database & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdfDatabase & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdf
Database & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdf
 
LALIT-TCS
LALIT-TCSLALIT-TCS
LALIT-TCS
 
Endofday: A Container Workflow Engine for Scalable, Reproducible Computation
Endofday: A Container Workflow Engine for Scalable, Reproducible ComputationEndofday: A Container Workflow Engine for Scalable, Reproducible Computation
Endofday: A Container Workflow Engine for Scalable, Reproducible Computation
 
Apache Spark: What? Why? When?
Apache Spark: What? Why? When?Apache Spark: What? Why? When?
Apache Spark: What? Why? When?
 
Architecting and productionising data science applications at scale
Architecting and productionising data science applications at scaleArchitecting and productionising data science applications at scale
Architecting and productionising data science applications at scale
 
Camunda BPM 7.2: Performance and Scalability (English)
Camunda BPM 7.2: Performance and Scalability (English)Camunda BPM 7.2: Performance and Scalability (English)
Camunda BPM 7.2: Performance and Scalability (English)
 

Mehr von NeerajKumar1965

Advanced Integrations of MuleSoft with ChatGTP
Advanced Integrations of MuleSoft with ChatGTPAdvanced Integrations of MuleSoft with ChatGTP
Advanced Integrations of MuleSoft with ChatGTPNeerajKumar1965
 
Liquibase Integration with MuleSoft
Liquibase Integration with MuleSoftLiquibase Integration with MuleSoft
Liquibase Integration with MuleSoftNeerajKumar1965
 
Introduction to CloudHub 2.0
Introduction to CloudHub 2.0Introduction to CloudHub 2.0
Introduction to CloudHub 2.0NeerajKumar1965
 
Deep Dive into Event Driven Architecture(Async API)
Deep Dive into Event Driven Architecture(Async API)Deep Dive into Event Driven Architecture(Async API)
Deep Dive into Event Driven Architecture(Async API)NeerajKumar1965
 
Accelerate integration with SAP using MuleSoft
Accelerate integration with SAP using MuleSoftAccelerate integration with SAP using MuleSoft
Accelerate integration with SAP using MuleSoftNeerajKumar1965
 
Deep Dive into Salesforce APIs
Deep Dive into Salesforce APIsDeep Dive into Salesforce APIs
Deep Dive into Salesforce APIsNeerajKumar1965
 
Automate mule deployments with github actions and travis ci
Automate mule deployments with github actions  and  travis ciAutomate mule deployments with github actions  and  travis ci
Automate mule deployments with github actions and travis ciNeerajKumar1965
 
Trailhead - The bridge between Salesforce and MuleSoft
Trailhead - The bridge between Salesforce and MuleSoftTrailhead - The bridge between Salesforce and MuleSoft
Trailhead - The bridge between Salesforce and MuleSoftNeerajKumar1965
 
Caching strategies in MuleSoft
Caching strategies in MuleSoftCaching strategies in MuleSoft
Caching strategies in MuleSoftNeerajKumar1965
 
Deep Dive on CI/CD NYC Meet Up Group
Deep Dive on CI/CD NYC Meet Up GroupDeep Dive on CI/CD NYC Meet Up Group
Deep Dive on CI/CD NYC Meet Up GroupNeerajKumar1965
 
Anypoint MQ-DLQ NYC Meet Up
Anypoint MQ-DLQ NYC Meet UpAnypoint MQ-DLQ NYC Meet Up
Anypoint MQ-DLQ NYC Meet UpNeerajKumar1965
 
Batch Processing with Mule 4
Batch Processing with Mule 4Batch Processing with Mule 4
Batch Processing with Mule 4NeerajKumar1965
 
Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021NeerajKumar1965
 
New York City Meetup- 6th March 2021
New York City Meetup- 6th March 2021New York City Meetup- 6th March 2021
New York City Meetup- 6th March 2021NeerajKumar1965
 

Mehr von NeerajKumar1965 (18)

Advanced Integrations of MuleSoft with ChatGTP
Advanced Integrations of MuleSoft with ChatGTPAdvanced Integrations of MuleSoft with ChatGTP
Advanced Integrations of MuleSoft with ChatGTP
 
Liquibase Integration with MuleSoft
Liquibase Integration with MuleSoftLiquibase Integration with MuleSoft
Liquibase Integration with MuleSoft
 
Introduction to CloudHub 2.0
Introduction to CloudHub 2.0Introduction to CloudHub 2.0
Introduction to CloudHub 2.0
 
Connect_Recap.pptx
Connect_Recap.pptxConnect_Recap.pptx
Connect_Recap.pptx
 
Deep Dive into Event Driven Architecture(Async API)
Deep Dive into Event Driven Architecture(Async API)Deep Dive into Event Driven Architecture(Async API)
Deep Dive into Event Driven Architecture(Async API)
 
Anypoint Data Graphs
Anypoint Data GraphsAnypoint Data Graphs
Anypoint Data Graphs
 
Accelerate integration with SAP using MuleSoft
Accelerate integration with SAP using MuleSoftAccelerate integration with SAP using MuleSoft
Accelerate integration with SAP using MuleSoft
 
Deep Dive into Salesforce APIs
Deep Dive into Salesforce APIsDeep Dive into Salesforce APIs
Deep Dive into Salesforce APIs
 
Automate mule deployments with github actions and travis ci
Automate mule deployments with github actions  and  travis ciAutomate mule deployments with github actions  and  travis ci
Automate mule deployments with github actions and travis ci
 
Trailhead - The bridge between Salesforce and MuleSoft
Trailhead - The bridge between Salesforce and MuleSoftTrailhead - The bridge between Salesforce and MuleSoft
Trailhead - The bridge between Salesforce and MuleSoft
 
Power of LWC + Mulesoft
Power of LWC + MulesoftPower of LWC + Mulesoft
Power of LWC + Mulesoft
 
Caching strategies in MuleSoft
Caching strategies in MuleSoftCaching strategies in MuleSoft
Caching strategies in MuleSoft
 
Deep Dive on CI/CD NYC Meet Up Group
Deep Dive on CI/CD NYC Meet Up GroupDeep Dive on CI/CD NYC Meet Up Group
Deep Dive on CI/CD NYC Meet Up Group
 
Integrating with Aws s3
Integrating with Aws s3Integrating with Aws s3
Integrating with Aws s3
 
Anypoint MQ-DLQ NYC Meet Up
Anypoint MQ-DLQ NYC Meet UpAnypoint MQ-DLQ NYC Meet Up
Anypoint MQ-DLQ NYC Meet Up
 
Batch Processing with Mule 4
Batch Processing with Mule 4Batch Processing with Mule 4
Batch Processing with Mule 4
 
Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021
 
New York City Meetup- 6th March 2021
New York City Meetup- 6th March 2021New York City Meetup- 6th March 2021
New York City Meetup- 6th March 2021
 

Kürzlich hochgeladen

SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 

Kürzlich hochgeladen (20)

SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 

Batch Message Listener capabilities of the Apache Kafka Connector

  • 1. Batch Message Listener capabilities of the Apache Kafka Connector New York MuleSoft Meetup Group June 25th, 2022
  • 2. 2 ▪ Around 14 years of Experience into ERP and Integrations. ▪ Working as Principal Architect @Slalom LLC. ▪ 3X MuleSoft Certified, 1X AWS Certified ▪ Managed multiple End to End Implementations/Integration projects. ▪ Mentoring Mule Developers and People trying to switch to MuleSoft. Introduction Neeraj Kumar- Host NYC
  • 3. Safe Harbor Statement ● Both the speaker and host are organizing this meet up in individual capacity only. We are not representing our companies here. ● This presentation is strictly for learning purpose only. Organizer/Presenter do not hold any responsibility that same solution will work for your business requirements also. ● This presentation is not meant for any promotional activities.
  • 4. 4 Lars Grube ●15 years of IT Software Engineering experience ●Works on business intelligence, data integration and training solutions ●Specialized in highly parallel processing APIs interacting with Teradata Vantage ●MuleSoft Certified Developer - Level 1 ●LinkedIn profile: https://www.linkedin.com/in/lars-grube Introductions
  • 5. 5 ● Why? ● The overall picture ● The detailed approach ● Live Demo ● Wrap up - Q&A Agenda
  • 7. 7 Teradata Vantage is optimized for parallel bulk inserts Why?
  • 9. 9 The overall picture MuleAPI Batch Message Listener Invalidmessages Source system Publish ApacheKafka Topic Partition Partition Partition Teradata Vantage Targettable Logtable ParallelForEach Bulkinsert Commit Success Failure Insert Failure
  • 11. 11 ● Should match approximately 1000 messages ● Should match default fetch maximum size ● Should be increased if default fetch minimum size is frequently missed ● Must be at least as long as fetch maximum wait timeout, preferably one minute longer Configuring the Apache Kafka Consumer
  • 12. 12 ● Implement a guard function in order to filter and log messages that cannot be parsed into the expected format ● Based on: https://blogs.mulesoft.com/dev-guides/how-to-tutorials/guarding- collections-dataweave-try-function-2/ ● Usage Extracting the payload from the batch message fun guardWithDefaultOutput (fn, defaultOutput = null) = dw::Runtime::try(fn) match { case tr if (tr.success) -> tr.result else -> defaultOutput } var payloadValues = (payload.*payload default [] map (value, index) -> do { var jsonVal = guard(() -> read(value, "application/json")) --- value: if (jsonVal is Null) null else { ...
  • 13. 13 ● Perform an explicit mapping for all fields to avoid implicit null values ● Segment the payload for parallel processing ● Combine the “Parallel For Each” scope and “Bulk Insert” component Inserting the data into the database var payloadValues = (payload.*payload default [] map (value, index) -> do { ... orderNo: jsonVal.orderNo, orderDate: jsonVal.orderDate, customerNo: jsonVal.customerNo, ... import divideBy as divBy from dw::core::Arrays --- (vars.batchMessagePayload filter not ($.value is Null)) divBy 100
  • 14. 14 ● Define the primary index of the target table on the correlation id and an ascending number by payload Inserting the data into the database CREATE MULTISET TABLE MULE.STG_FACT_ORDERS ( orderNo BIGINT NOT NULL, orderDate DATE FORMAT 'YYYY-MM-DD' NOT NULL, customerNo BIGINT NOT NULL, itemNo BIGINT NOT NULL, itemDesc VARCHAR(100) CHARACTER SET UNICODE NOT CASESPECIFIC NOT NULL, orderState VARCHAR(30) CHARACTER SET UNICODE NOT CASESPECIFIC NOT NULL, lastUpdatedTS TIMESTAMP(3) WITH TIME ZONE NOT NULL, mule_correlation_id VARCHAR(128) CHARACTER SET UNICODE NOT CASESPECIFIC NOT NULL, row_number_by_payload INTEGER NOT NULL) PRIMARY INDEX ( mule_correlation_id ,row_number_by_payload ); var payloadValues = (payload.*payload default [] map (value, index) -> do { ... mule_correlation_id: correlationId, row_number_by_payload: index }
  • 15. 15 ● Use the message attributes (key, creation timestamp, partition, offset) for precisely logging problematic messages ● Identify irreproducible database issues ● Error type "DB:CONNECTIVITY" ● Error type "MULE:COMPOSITE_ROUTING" containing "DB:CONNECTIVITY" error or another nested "MULE:COMPOSITE_ROUTING" ● Teradata error codes (2631, 1095, 3134) ● In case of a reproducible database issue occuring during the bulk insert, split the message array into its items and perform parallel inserts on the item level ● In case of an irreproducible database issue or any other error, rely on the default behaviour (redelivery) Handling errors (error.errors ++ (flatten(error.errors.*errors) default [])).*errorType.*asString contains "DB:CONNECTIVITY"
  • 17. 17 ● Performance comparison between single and batch message listener ● Handling irreproducible database issues ● Handling and logging problematic message data and reproducible database issues Live Demo
  • 18. 18 ● Teradata Vantage Express on VMWare Workstation Player https://downloads.teradata.com/download/database/teradata-express-for-vmware-player https://downloads.vmware.com/d/ ● Apache Kafka on Ubuntu https://kafka.apache.org/ https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-10 ● AKHQ https://akhq.io ● API implementation https://github.com/larsgrube/teradata-fast-import/tree/master/teradata-import-api Components overview
  • 19. Q & A
  • 20. Quiz Time Get ready to WIN a Special Gift from MuleSoft Community
  • 21. 21 ● Functions for catching and handling DataWeave errors are available in the module dw:: … a) Core b) Mule c) Runtime d) System Q1
  • 22. 22 ● Which Apache Kafka Consumer configuration parameter should be checked and, if necessary, increased when increasing the fetch maximum wait timeout? a) Request timeout b) Session timeout c) Maximum polling interval d) All of the above Q2
  • 23. 23 ● What primary index of a target table should be chosen for parallel bulk inserts? a) Logical key, correlation id, insert timestamp b) Correlation id, row number by payload c) Surrogate key d) No primary index Q3