adambien / porcupine Goto Github PK
View Code? Open in Web Editor NEWThreading, Resiliency and Monitoring for Java EE 7/8
License: Apache License 2.0
Threading, Resiliency and Monitoring for Java EE 7/8
License: Apache License 2.0
deploying a maven project to glassfish (payara 1.4.151) (from NetBeans) and doing a mvn clean afterwards resulting in the following message:
Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project api-server-web: Failed to clean project: Failed to delete ....\WEB-INF\lib\porcupine-0.0.4.jar
I'm not sure if this is by design, but when I use a "custom" reject policy i.e. .discard or abort then the porpupine statistics module doesn't register the rejection.
This is obviously because the onRejectedExecution method is never called.
Can we have the cookie and eat it too? Provide different rejection handler and see it in the stats :)
Adam,
Is there any interest in updating this to support Jakarta EE? I did a quick and dirty migration updating the imports and temporarily commenting out all the tests and it appears to run fine in Jakarta EE 10.
I was using porcupine to create an ExecutorService in my project. When I would send in my first round of Runnables into the executor everything worked as expected. I then tried added another round of Runnables into the executor and was running into permissions issues. I checked the logs and the second round of runnables were running as the original user. I had to use a ManagedExecutorService instead to get the SessionContext to properly propagate into the Runnables. I wrote a stackoverflow question that provides a more clear example: http://stackoverflow.com/questions/40002010/how-to-avoid-executorservice-from-overridding-security-principal-of-a-runnable
Are the ExecutorService and the generated threads supposed to be container manager or is that an invalid assumption that I made?
I really wanna use my own ThreadFactory implementation.
Is there a way to inject it into the ExecutorServiceExposer?
Thanks!
Hi Adam,
I am not able to override porcupine default configuration. I wrote this class:
import com.airhacks.porcupine.configuration.control.ExecutorConfigurator;
import com.airhacks.porcupine.execution.control.ExecutorConfiguration;
import javax.enterprise.inject.Specializes;
@Specializes
public class CustomExecutorConfigurator extends ExecutorConfigurator {
@Override
public ExecutorConfiguration defaultConfigurator() {
return super.defaultConfigurator();
}
@Override
public ExecutorConfiguration forPipeline(String name) {
return new ExecutorConfiguration.Builder().
corePoolSize(4).
maxPoolSize(83).
queueCapacity(16).
keepAliveTime(1).
callerRunsPolicy().
build();
}
}
but when I hit statistics endpoint a I see still default configuration.
{
"pipelineName": "archiveBrowsableDays-endpoint-executor",
"remainingQueueCapacity": 100,
"minQueueCapacity": 100,
"completedTaskCount": 0,
"activeThreadCount": 0,
"largestThreadPoolSize": 0,
"currentThreadPoolSize": 0,
"totalNumberOfTasks": 0,
"maximumPoolSize": 16,
"rejectedExecutionHandlerName": "ExecutorServiceExposer$$Lambda$3957/1578815540",
"rejectedTasks": 0,
"corePoolSize": 8
},
{
"pipelineName": "init-endpoint-executor",
"remainingQueueCapacity": 100,
"minQueueCapacity": 100,
"completedTaskCount": 1,
"activeThreadCount": 0,
"largestThreadPoolSize": 1,
"currentThreadPoolSize": 1,
"totalNumberOfTasks": 1,
"maximumPoolSize": 16,
"rejectedExecutionHandlerName": "ExecutorServiceExposer$$Lambda$3957/1578815540",
"rejectedTasks": 0,
"corePoolSize": 8
}
What I do wrong? Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.