JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-4784

Endpoint filters not applied when invokes via the quartz:job-endpoint

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Patch submission Patch submission
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 2.2.1
  • Fix Version/s: 3.0.1, 3.1.0, Bug Backlog
  • Component/s: Transport: Quartz
  • Labels:
    None
  • Environment:

    jdk: 1.6
    jre: java-6-sun-1.6.0.16
    OS: ubuntu 9.0.4

  • User impact:
    Low
  • Configuration:
    Hide

    <?xml version="1.0" encoding="UTF-8"?>
    <mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:file="http://www.mulesource.org/schema/mule/file/2.2"
    xmlns:quartz="http://www.mulesource.org/schema/mule/quartz/2.2"
    xsi:schemaLocation="
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
    http://www.mulesource.org/schema/mule/file/2.2 http://www.mulesource.org/schema/mule/file/2.2/mule-file.xsd
    http://www.mulesource.org/schema/mule/quartz/2.2 http://www.mulesource.org/schema/mule/quartz/2.2/mule-quartz.xsd
    http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd">

    <context:property-placeholder location="classpath:META-INF/properties/test.properties"/>

    <file:endpoint connector-ref="FileConnector" name="FileSource" path="${source.path}" moveToDirectory="${sent.dir}">
    <file:filename-wildcard-filter pattern="*.txt"/>
    </file:endpoint>

    <file:connector name="FileConnector" />

    <model>

    <service name="Directory Polling Service">

    <description>
    Wake up and check the folder for files
    </description>

    <inbound>
    <quartz:inbound-endpoint jobName="FilePollingJob" cronExpression="${cron-expression}">
    <quartz:endpoint-polling-job>
    <quartz:job-endpoint ref="FileSource"/>
    </quartz:endpoint-polling-job>
    </quartz:inbound-endpoint>
    </inbound>

    <outbound>
    <pass-through-router>
    <file:outbound-endpoint path="${dest.dir}" outputPattern="#[ORIGINALNAME]-processed"/>
    </pass-through-router>
    </outbound>

    </service>

    </model>

    </mule>

    Properties :

    source.path=/home/david/pplusnt/PPDB0003/
    upload.dir=/home/david/ABFFlex/uploadQueue
    upload.dir=/home/david/ABFFlex/uploadQueue
    cron-expression=0/30 * * * * ?

    Show
    <?xml version="1.0" encoding="UTF-8"?> <mule xmlns="http://www.mulesource.org/schema/mule/core/2.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:file="http://www.mulesource.org/schema/mule/file/2.2" xmlns:quartz="http://www.mulesource.org/schema/mule/quartz/2.2" xsi:schemaLocation=" http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.mulesource.org/schema/mule/file/2.2 http://www.mulesource.org/schema/mule/file/2.2/mule-file.xsd http://www.mulesource.org/schema/mule/quartz/2.2 http://www.mulesource.org/schema/mule/quartz/2.2/mule-quartz.xsd http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd"> <context:property-placeholder location="classpath:META-INF/properties/test.properties"/> <file:endpoint connector-ref="FileConnector" name="FileSource" path="${source.path}" moveToDirectory="${sent.dir}"> <file:filename-wildcard-filter pattern="*.txt"/> </file:endpoint> <file:connector name="FileConnector" /> <model> <service name="Directory Polling Service"> <description> Wake up and check the folder for files </description> <inbound> <quartz:inbound-endpoint jobName="FilePollingJob" cronExpression="${cron-expression}"> <quartz:endpoint-polling-job> <quartz:job-endpoint ref="FileSource"/> </quartz:endpoint-polling-job> </quartz:inbound-endpoint> </inbound> <outbound> <pass-through-router> <file:outbound-endpoint path="${dest.dir}" outputPattern="#[ORIGINALNAME]-processed"/> </pass-through-router> </outbound> </service> </model> </mule> Properties : source.path=/home/david/pplusnt/PPDB0003/ upload.dir=/home/david/ABFFlex/uploadQueue upload.dir=/home/david/ABFFlex/uploadQueue cron-expression=0/30 * * * * ?
  • Similar Issues:
    None

Description

When I attempt to utilize a quartz-endpoint-polling-job to grab files from a file-endpoint, the <file:filename-wildcard-filter> I have configured on the file-endpoint is NOT applied, and ALL of the files in the specified directory are processed including sub-directories

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Java Source File
    EndpointPollingJob.java
    12/Mar/10 10:34 AM
    5 kB
    David Kjerrumgaard

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
Hide
Permalink
David Kjerrumgaard added a comment - 11/Mar/10 02:59 PM

The problematic class is or.mule.transport,quartz.EndpointPollingJob,

public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {

....

try
{
MuleClient client = connector.getClient();
logger.debug("Attempting to receive event on: " + jobConfig.getEndpointRef());

/* PROBLEM OCCURS ON THE NEXT LINE.
*

  • The code needs to handle InboundEndpoints and OutBoundEndpoints differently, specifically
  • applying the filters to InboundEndpoints.....
    */
    MuleMessage result = client.request(jobConfig.getEndpointRef(), jobConfig.getTimeout());

if (result != null)
{
if (logger.isDebugEnabled())

{ logger.debug("Received event on: " + jobConfig.getEndpointRef()); }

//we need to do this because
result = (MuleMessage)((ThreadSafeAccess)result).newThreadCopy();

//Add the context properties to the message.
result.addProperties(jobDataMap, PropertyScope.INVOCATION);

receiver.routeMessage(result);
}
}
catch (MuleException e)

{ throw new JobExecutionException(e); }
Show
David Kjerrumgaard added a comment - 11/Mar/10 02:59 PM The problematic class is or.mule.transport,quartz.EndpointPollingJob, public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { .... try { MuleClient client = connector.getClient(); logger.debug("Attempting to receive event on: " + jobConfig.getEndpointRef()); /* PROBLEM OCCURS ON THE NEXT LINE. *
  • The code needs to handle InboundEndpoints and OutBoundEndpoints differently, specifically
  • applying the filters to InboundEndpoints..... */ MuleMessage result = client.request(jobConfig.getEndpointRef(), jobConfig.getTimeout());
if (result != null) { if (logger.isDebugEnabled()) { logger.debug("Received event on: " + jobConfig.getEndpointRef()); } //we need to do this because result = (MuleMessage)((ThreadSafeAccess)result).newThreadCopy(); //Add the context properties to the message. result.addProperties(jobDataMap, PropertyScope.INVOCATION); receiver.routeMessage(result); } } catch (MuleException e) { throw new JobExecutionException(e); }
Hide
Permalink
David Kjerrumgaard added a comment - 12/Mar/10 10:34 AM

I have implemented a slight code change to the EndpointPollingJob class, which checks to see if the configured endpoint is an InboundEndpoint, and if so, uses the InboundEndpoint's request method, which incorporates the endpoint's configured filters & transformers automatically.

I have attached the code, which I have tested and confirmed that it is working with the code from the 2.2.6-SNAPSHOT codebase.

Show
David Kjerrumgaard added a comment - 12/Mar/10 10:34 AM I have implemented a slight code change to the EndpointPollingJob class, which checks to see if the configured endpoint is an InboundEndpoint, and if so, uses the InboundEndpoint's request method, which incorporates the endpoint's configured filters & transformers automatically. I have attached the code, which I have tested and confirmed that it is working with the code from the 2.2.6-SNAPSHOT codebase.
David Kjerrumgaard made changes - 12/Mar/10 10:34 AM
Field Original Value New Value
Attachment EndpointPollingJob.java [ 12629 ]
Mike Schilling made changes - 18/Oct/10 02:34 PM
Issue Type Bug [ 1 ] Patch submission [ 5 ]
Fix Version/s Bug Backlog [ 10522 ]
Priority To be reviewed [ 6 ] Critical [ 2 ]
Dirk Olmes made changes - 26/Oct/10 11:17 AM
Assignee Mike Schilling [ mike.schilling ]
Mike Schilling made changes - 26/Oct/10 03:19 PM
Fix Version/s 3.0.1 [ 10877 ]
Mike Schilling made changes - 27/Oct/10 02:59 PM
Link This issue blocks BL-294 [ BL-294 ]
Hide
Permalink
Mike Schilling added a comment - 05/Nov/10 06:09 PM

This works correctly in 3.x, possibly as a result of http://fisheye.codehaus.org/changelog/mule/?cs=15672

Show
Mike Schilling added a comment - 05/Nov/10 06:09 PM This works correctly in 3.x, possibly as a result of http://fisheye.codehaus.org/changelog/mule/?cs=15672
Mike Schilling made changes - 05/Nov/10 06:09 PM
Status Open [ 1 ] Closed [ 6 ]
Fix Version/s 3.1.0 [ 10898 ]
Resolution Fixed [ 1 ]
Hide
Permalink
Travis Carlson added a comment - 20/Dec/10 08:40 AM

DZ (from QA spreadsheet): integrate config and create an automated test

Show
Travis Carlson added a comment - 20/Dec/10 08:40 AM DZ (from QA spreadsheet): integrate config and create an automated test
Transition Time In Source Status Execution Times Last Executer Last Execution Date
Open Open Closed Closed
239d 2h 23m 1 Mike Schilling 05/Nov/10 06:09 PM
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
  • Repository mule on http://foo.bar/ failed: Error in remote call to 'FishEye 0 (http://foo.bar/)' (http://foo.bar) [AbstractRestCommand{path='/rest-service-fe/changeset-v1/listChangesets/', params={expand=changesets[-21:-1].revisions[0:29], comment=MULE-4784, p4JobFixed=MULE-4784, rep=mule}, methodType=GET}] : java.net.UnknownHostException: foo.bar

People

  • Assignee:
    Mike Schilling
    Reporter:
    David Kjerrumgaard
Vote (0)
Watch (0)

Dates

  • Created:
    11/Mar/10 02:45 PM
    Updated:
    20/Dec/10 08:40 AM
    Resolved:
    05/Nov/10 06:09 PM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.