SlideShare a Scribd company logo
1 of 6
Creating Custom Filter
- By Rahul Kumar
Custom Filter
Create your own Filter implementation by
Implementing org.mule.api.routing.filter interface
Overriding the standard implementations of org.mule.api.routing.filter like
org.mule.routing.filters.ExpressionFilter (used in Expression Filter component),
org.mule.routing.filters.PayloadTypeFilter (used in Payload filter component) and many
mores
Snippet for Custom Filter
package org.rahul.mule.filter;
import org.mule.api.MuleMessage;
import org.mule.api.routing.filter.Filter;
public class InputStreamFilter implements Filter{
@Override
public boolean accept(MuleMessage message) {
Object obj = message.getPayload();
/* Return Payload is a Stream or not*/
return obj instanceof java.io.InputStream;
}
}
Snippet for Custom Filter
The snippet shown will create a Filter which will allow only Streamable
payload to pass through i.e. of type java.io.InputStream
Configuration
Provide this class in Custom Filter component from the palette.
<custom-filter class="org.rahul.mule.filter.InputStreamFilter"
doc:name="Streamable Filter">
</custom-filter>
Your custom filter is now ready to use!
Thank You

More Related Content

Similar to Creating custom filter

quickguide-einnovator-2-spring4-dependency-injection-annotations
quickguide-einnovator-2-spring4-dependency-injection-annotationsquickguide-einnovator-2-spring4-dependency-injection-annotations
quickguide-einnovator-2-spring4-dependency-injection-annotations
jorgesimao71
 
Java Tech & Tools | OSGi Best Practices | Emily Jiang
Java Tech & Tools | OSGi Best Practices | Emily JiangJava Tech & Tools | OSGi Best Practices | Emily Jiang
Java Tech & Tools | OSGi Best Practices | Emily Jiang
JAX London
 
Java applet basics
Java applet basicsJava applet basics
Java applet basics
Sunil Pandey
 

Similar to Creating custom filter (20)

quickguide-einnovator-2-spring4-dependency-injection-annotations
quickguide-einnovator-2-spring4-dependency-injection-annotationsquickguide-einnovator-2-spring4-dependency-injection-annotations
quickguide-einnovator-2-spring4-dependency-injection-annotations
 
Plugins And Making Your Own
Plugins And Making Your OwnPlugins And Making Your Own
Plugins And Making Your Own
 
SoapUI Pro Plugin Workshop #SoapUIPlugins
SoapUI Pro Plugin Workshop #SoapUIPluginsSoapUI Pro Plugin Workshop #SoapUIPlugins
SoapUI Pro Plugin Workshop #SoapUIPlugins
 
Custom filters in mule soft
Custom filters in mule softCustom filters in mule soft
Custom filters in mule soft
 
Java Tech & Tools | OSGi Best Practices | Emily Jiang
Java Tech & Tools | OSGi Best Practices | Emily JiangJava Tech & Tools | OSGi Best Practices | Emily Jiang
Java Tech & Tools | OSGi Best Practices | Emily Jiang
 
Creating global functions
Creating global functionsCreating global functions
Creating global functions
 
Java Components and their applicability in Mule Anypoint Studio
Java Components and their applicability in Mule Anypoint StudioJava Components and their applicability in Mule Anypoint Studio
Java Components and their applicability in Mule Anypoint Studio
 
#11.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_국비지원학원,재직자/실업자교육학원,스프링교육,마이바...
#11.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_국비지원학원,재직자/실업자교육학원,스프링교육,마이바...#11.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_국비지원학원,재직자/실업자교육학원,스프링교육,마이바...
#11.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_국비지원학원,재직자/실업자교육학원,스프링교육,마이바...
 
Java applet basics
Java applet basicsJava applet basics
Java applet basics
 
java Unit4 chapter1 applets
java Unit4 chapter1 appletsjava Unit4 chapter1 applets
java Unit4 chapter1 applets
 
Applet1 (1).pptx
Applet1 (1).pptxApplet1 (1).pptx
Applet1 (1).pptx
 
Introduction to OSGi
Introduction to OSGiIntroduction to OSGi
Introduction to OSGi
 
Python modules
Python modulesPython modules
Python modules
 
J2ee standards > CDI
J2ee standards > CDIJ2ee standards > CDI
J2ee standards > CDI
 
Vtlib 1.1
Vtlib 1.1Vtlib 1.1
Vtlib 1.1
 
oops with java modules iii & iv.pptx
oops with java modules iii & iv.pptxoops with java modules iii & iv.pptx
oops with java modules iii & iv.pptx
 
Java 8 Feature Preview
Java 8 Feature PreviewJava 8 Feature Preview
Java 8 Feature Preview
 
Getting modular with OSGI
Getting modular with OSGIGetting modular with OSGI
Getting modular with OSGI
 
Smart material - Unit 3 (2).pdf
Smart material - Unit 3 (2).pdfSmart material - Unit 3 (2).pdf
Smart material - Unit 3 (2).pdf
 
Smart material - Unit 3 (1).pdf
Smart material - Unit 3 (1).pdfSmart material - Unit 3 (1).pdf
Smart material - Unit 3 (1).pdf
 

More from Rahul Kumar

More from Rahul Kumar (20)

Combine collections transformer
Combine collections transformerCombine collections transformer
Combine collections transformer
 
Creating custom object store
Creating custom object storeCreating custom object store
Creating custom object store
 
Using parse template component
Using parse template componentUsing parse template component
Using parse template component
 
Using groovy component
Using groovy componentUsing groovy component
Using groovy component
 
Using expression component
Using expression componentUsing expression component
Using expression component
 
Byte array to hex string transformer
Byte array to hex string transformerByte array to hex string transformer
Byte array to hex string transformer
 
Hex string to byte array transformer
Hex string to byte array transformerHex string to byte array transformer
Hex string to byte array transformer
 
XML to DOM Transformer
XML to DOM TransformerXML to DOM Transformer
XML to DOM Transformer
 
Dom to xml transformer
Dom to xml transformerDom to xml transformer
Dom to xml transformer
 
Object to input stream transformer
Object to input stream transformerObject to input stream transformer
Object to input stream transformer
 
Byte array to object transformer
Byte array to object transformerByte array to object transformer
Byte array to object transformer
 
Byte array to string transformer
Byte array to string transformerByte array to string transformer
Byte array to string transformer
 
Object to string transformer
Object to string transformerObject to string transformer
Object to string transformer
 
Csv to json transform in simple steps
Csv to json transform in simple stepsCsv to json transform in simple steps
Csv to json transform in simple steps
 
Using scatter gather
Using scatter gatherUsing scatter gather
Using scatter gather
 
Choice router
Choice routerChoice router
Choice router
 
Using idempotent filter
Using idempotent filterUsing idempotent filter
Using idempotent filter
 
Using expression filter
Using expression filterUsing expression filter
Using expression filter
 
Using JSON Schema Validator
Using JSON Schema ValidatorUsing JSON Schema Validator
Using JSON Schema Validator
 
Quartz connector
Quartz connectorQuartz connector
Quartz connector
 

Recently uploaded

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
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Recently uploaded (20)

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
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...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
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
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
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-...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 

Creating custom filter

  • 1. Creating Custom Filter - By Rahul Kumar
  • 2. Custom Filter Create your own Filter implementation by Implementing org.mule.api.routing.filter interface Overriding the standard implementations of org.mule.api.routing.filter like org.mule.routing.filters.ExpressionFilter (used in Expression Filter component), org.mule.routing.filters.PayloadTypeFilter (used in Payload filter component) and many mores
  • 3. Snippet for Custom Filter package org.rahul.mule.filter; import org.mule.api.MuleMessage; import org.mule.api.routing.filter.Filter; public class InputStreamFilter implements Filter{ @Override public boolean accept(MuleMessage message) { Object obj = message.getPayload(); /* Return Payload is a Stream or not*/ return obj instanceof java.io.InputStream; } }
  • 4. Snippet for Custom Filter The snippet shown will create a Filter which will allow only Streamable payload to pass through i.e. of type java.io.InputStream
  • 5. Configuration Provide this class in Custom Filter component from the palette. <custom-filter class="org.rahul.mule.filter.InputStreamFilter" doc:name="Streamable Filter"> </custom-filter> Your custom filter is now ready to use!