SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

La actualidad más candente

The RabbitMQ Message Broker
The RabbitMQ Message BrokerThe RabbitMQ Message Broker
The RabbitMQ Message BrokerMartin Toshev
 
414: Build an agile CI/CD Pipeline for application integration
414: Build an agile CI/CD Pipeline for application integration414: Build an agile CI/CD Pipeline for application integration
414: Build an agile CI/CD Pipeline for application integrationTrevor Dolby
 
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffArchitecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffJAX London
 
Cloud computing and OpenStack
Cloud computing and OpenStackCloud computing and OpenStack
Cloud computing and OpenStackEdgar Magana
 
Introduction to Enterprise Service Bus
Introduction to Enterprise Service BusIntroduction to Enterprise Service Bus
Introduction to Enterprise Service BusMahmoud Ezzat
 
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
 
Websphere MQ admin guide
Websphere MQ admin guideWebsphere MQ admin guide
Websphere MQ admin guideRam Babu
 
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEV
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEVMicroservices Tracing With Spring Cloud and Zipkin @CybercomDEV
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEVMarcin Grzejszczak
 
IBM MQ - What's new in 9.2
IBM MQ - What's new in 9.2IBM MQ - What's new in 9.2
IBM MQ - What's new in 9.2David Ware
 
Container orchestration overview
Container orchestration overviewContainer orchestration overview
Container orchestration overviewWyn B. Van Devanter
 
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
BPF  & Cilium - Turning Linux into a Microservices-aware Operating SystemBPF  & Cilium - Turning Linux into a Microservices-aware Operating System
BPF & Cilium - Turning Linux into a Microservices-aware Operating SystemThomas Graf
 
IBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
IBM MQ: Managing Workloads, Scaling and Availability with MQ ClustersIBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
IBM MQ: Managing Workloads, Scaling and Availability with MQ ClustersDavid Ware
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQAll Things Open
 
IBM DataPower Gateway - Common Use Cases
IBM DataPower Gateway - Common Use CasesIBM DataPower Gateway - Common Use Cases
IBM DataPower Gateway - Common Use CasesIBM DataPower Gateway
 
Kubernetes networking: Introduction to overlay networks, communication models...
Kubernetes networking: Introduction to overlay networks, communication models...Kubernetes networking: Introduction to overlay networks, communication models...
Kubernetes networking: Introduction to overlay networks, communication models...Murat Mukhtarov
 
Spring Boot+Kafka: the New Enterprise Platform
Spring Boot+Kafka: the New Enterprise PlatformSpring Boot+Kafka: the New Enterprise Platform
Spring Boot+Kafka: the New Enterprise PlatformVMware Tanzu
 
Traffic Control with Envoy Proxy
Traffic Control with Envoy ProxyTraffic Control with Envoy Proxy
Traffic Control with Envoy ProxyMark McBride
 
Open Ethernet: an open-source approach to modern network design
Open Ethernet: an open-source approach to modern network designOpen Ethernet: an open-source approach to modern network design
Open Ethernet: an open-source approach to modern network designAlexander Petrovskiy
 

La actualidad más candente (20)

The RabbitMQ Message Broker
The RabbitMQ Message BrokerThe RabbitMQ Message Broker
The RabbitMQ Message Broker
 
414: Build an agile CI/CD Pipeline for application integration
414: Build an agile CI/CD Pipeline for application integration414: Build an agile CI/CD Pipeline for application integration
414: Build an agile CI/CD Pipeline for application integration
 
RabbitMQ & Kafka
RabbitMQ & KafkaRabbitMQ & Kafka
RabbitMQ & Kafka
 
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffArchitecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
 
Cloud computing and OpenStack
Cloud computing and OpenStackCloud computing and OpenStack
Cloud computing and OpenStack
 
Introduction to Enterprise Service Bus
Introduction to Enterprise Service BusIntroduction to Enterprise Service Bus
Introduction to Enterprise Service Bus
 
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)
 
Websphere MQ admin guide
Websphere MQ admin guideWebsphere MQ admin guide
Websphere MQ admin guide
 
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEV
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEVMicroservices Tracing With Spring Cloud and Zipkin @CybercomDEV
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEV
 
IBM MQ - What's new in 9.2
IBM MQ - What's new in 9.2IBM MQ - What's new in 9.2
IBM MQ - What's new in 9.2
 
Container orchestration overview
Container orchestration overviewContainer orchestration overview
Container orchestration overview
 
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
BPF  & Cilium - Turning Linux into a Microservices-aware Operating SystemBPF  & Cilium - Turning Linux into a Microservices-aware Operating System
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
 
IBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
IBM MQ: Managing Workloads, Scaling and Availability with MQ ClustersIBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
IBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
 
Building microservices with grpc
Building microservices with grpcBuilding microservices with grpc
Building microservices with grpc
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQ
 
IBM DataPower Gateway - Common Use Cases
IBM DataPower Gateway - Common Use CasesIBM DataPower Gateway - Common Use Cases
IBM DataPower Gateway - Common Use Cases
 
Kubernetes networking: Introduction to overlay networks, communication models...
Kubernetes networking: Introduction to overlay networks, communication models...Kubernetes networking: Introduction to overlay networks, communication models...
Kubernetes networking: Introduction to overlay networks, communication models...
 
Spring Boot+Kafka: the New Enterprise Platform
Spring Boot+Kafka: the New Enterprise PlatformSpring Boot+Kafka: the New Enterprise Platform
Spring Boot+Kafka: the New Enterprise Platform
 
Traffic Control with Envoy Proxy
Traffic Control with Envoy ProxyTraffic Control with Envoy Proxy
Traffic Control with Envoy Proxy
 
Open Ethernet: an open-source approach to modern network design
Open Ethernet: an open-source approach to modern network designOpen Ethernet: an open-source approach to modern network design
Open Ethernet: an open-source approach to modern network design
 

Similar a 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
 

Similar a 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)
 

Más de 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
 
Shopify Mulesoft Integrations
Shopify Mulesoft IntegrationsShopify Mulesoft Integrations
Shopify Mulesoft IntegrationsNeerajKumar1965
 
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
 

Más de NeerajKumar1965 (19)

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
 
Shopify Mulesoft Integrations
Shopify Mulesoft IntegrationsShopify Mulesoft Integrations
Shopify Mulesoft Integrations
 
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
 

Último

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 

Último (20)

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 

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