Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.2.5 (EE only)
  • Fix Version/s: 2.2.8 (EE only), 3.1.1
  • Component/s: Core: (other)
  • Labels:
    None
  • User impact:
    Medium
  • Affects Docs:
    Yes
  • Similar Issues:
    None

Description

I have a custom ThreadPoolFactory which must be used in favor of the one in mule-core-ee-2.2.5.jar

The discovery mechanism picks the first implementation jar which contains com.mulesoft.mule.config.Preferred
Since this simply chooses the first one it finds, it is not possible to guarantee that it picks mine

There are two workarounds, both unacceptable in the long term:

Disallow the mule-core-ee-2.2.5 jar from the classpath
Remove com.mulesoft.mule.config.Preferred from mule-core-ee-2.2.5.jar
A valid solution would be something like:

System property allowing exact specification
mule xml configuration allowing exact specification
Weighting as mentioned in below nabble link
etc...
See http://old.nabble.com/Thread-setup-cleanup-tt28413607.html#a28438680

NOTE: Our Mule instances are embedded, NOT standalone.

Issue Links

Activity

Hide
Pablo Kraan added a comment -

In order to configure a non default ThreadPoolFactory in mule using SPI:

1) The class should extend the org.mule.config.pool.ThreadPoolFactory and should be annotated with the org.mule.config.Preferred annotation using a positive weight. The annotation will let Mule to choose that class from the list of available implementations. (Example: @Preferred(weight = 10))

2) After that, the class should be register as a service so the javax.imageio.spi.ServiceRegistry will find it. To do that, you need to create a new file inside the META-INF/services folder. The file name should be "org.mule.config.pool.ThreadPoolFactory" and it must contain the full qualified name of the new class that implements the ThreadPoolFactory service.

Show
Pablo Kraan added a comment - In order to configure a non default ThreadPoolFactory in mule using SPI: 1) The class should extend the org.mule.config.pool.ThreadPoolFactory and should be annotated with the org.mule.config.Preferred annotation using a positive weight. The annotation will let Mule to choose that class from the list of available implementations. (Example: @Preferred(weight = 10)) 2) After that, the class should be register as a service so the javax.imageio.spi.ServiceRegistry will find it. To do that, you need to create a new file inside the META-INF/services folder. The file name should be "org.mule.config.pool.ThreadPoolFactory" and it must contain the full qualified name of the new class that implements the ThreadPoolFactory service.
Hide
Andrew Perepelytsya added a comment -

Pablo, there's a doc page I created initially: http://corp.wiki.mulesource.com/display/MULEDEV/SPI+Discovery+Mechanism

Makes sense to update it with your changes and move out to the public wiki.

Show
Andrew Perepelytsya added a comment - Pablo, there's a doc page I created initially: http://corp.wiki.mulesource.com/display/MULEDEV/SPI+Discovery+Mechanism Makes sense to update it with your changes and move out to the public wiki.
Hide
Pablo Kraan added a comment -

Marked the old page as deprecated.
Added a new page with the updated info: http://corp.wiki.mulesource.com/display/MULEDEV/New+SPI+Discovery+Mechanism

Show
Pablo Kraan added a comment - Marked the old page as deprecated. Added a new page with the updated info: http://corp.wiki.mulesource.com/display/MULEDEV/New+SPI+Discovery+Mechanism
Hide
Pablo Kraan added a comment -

Please add the info from this page http://corp.wiki.mulesource.com/display/MULEDEV/New+SPI+Discovery+Mechanism in the online documentation

Show
Pablo Kraan added a comment - Please add the info from this page http://corp.wiki.mulesource.com/display/MULEDEV/New+SPI+Discovery+Mechanism in the online documentation
Hide
Pablo Kraan added a comment -

Adding the places were the documentation should be updated as per Matt request.

The topic covered in this change is pretty advanced and it should be in a developer
guide if we have on. Maybe the MuleDeveloperGuide that David is writing is a good
place to add it.

Otherwise, the info should be a new item in the "Mule user guide".
Mule 2: http://www.mulesoft.org/documentation/display/MULE2USER/Home ("Beyond the basics" section)
Mule 3: http://www.mulesoft.org/documentation/display/MULE3USER/Beyond+the+Basics+of+Mule+ESB+3

Show
Pablo Kraan added a comment - Adding the places were the documentation should be updated as per Matt request. The topic covered in this change is pretty advanced and it should be in a developer guide if we have on. Maybe the MuleDeveloperGuide that David is writing is a good place to add it. Otherwise, the info should be a new item in the "Mule user guide". Mule 2: http://www.mulesoft.org/documentation/display/MULE2USER/Home ("Beyond the basics" section) Mule 3: http://www.mulesoft.org/documentation/display/MULE3USER/Beyond+the+Basics+of+Mule+ESB+3
Hide
Matt Brandabur added a comment -

Added to the Mule ESB 3.1 doc outline. This topic will be created in the new structure as part of the doc reorg. The new structure is not available yet. Will be done around end of Jan 2011.

Show
Matt Brandabur added a comment - Added to the Mule ESB 3.1 doc outline. This topic will be created in the new structure as part of the doc reorg. The new structure is not available yet. Will be done around end of Jan 2011.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: