GithubHelp home page GithubHelp logo

regunathb / trooper Goto Github PK

View Code? Open in Web Editor NEW
43.0 43.0 35.0 4.14 MB

Trooper is a Java-module like framework for building applications using one of the supported runtime profiles. Currently supported profiles include Batch, Service and Orchestration. It additionally has a number of useful libraries that may be used independently of the Trooper runtime.

Java 95.16% CSS 2.09% FreeMarker 2.75%

trooper's People

Contributors

devashishshankar avatar jagadeesh-huliyar avatar kapillamba4 avatar pmohankumar avatar regunathb avatar shashiks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trooper's Issues

Alphabetical sort in Jobs page

Is it possible to sort jobs in Jobs and Jobs Configuration pages ? With more than 20 jobs (pagination) it will be usefull.

Questions about Trooper

Hi!

I'm checking out Trooper, it looks like a terrific product that you've built on top of Spring Batch Admin!

We really like how you've added in the capability to upload entire jobs. We would like to have a standalone console that enables us to simply add jobs without having to redeploy the entire console, and it appears that Trooper provides this.

  • When adding jobs to Trooper, is it possible to simply upload a single jar file that contains a single job (or a collection of logically related jobs)? The jar file would be a "fat" jar consist of a folder (e.g. /META-INF/spring/batch/jobs) with XML job configurations and all dependencies of the job.
  • The original Spring Batch Admin console has a feature for uploading data files. It appears that this has been removed from Trooper. Is there a limitation in Trooper that prevents that from being available? How much work would it be (for you or an outsider) to add that back in?

Thanks!

Error during Example build

Tried compiling the batch example with following command

mvn clean install -f ./pom-examples-batch-with-dep.xml

[ERROR] Failed to execute goal on project dataaccess-hbase: Could not resolve dependencies for project org.trpr:dataaccess-hbase:jar:1.2.1: The following artifacts could not be resolved: org.apache.hadoop:hadoop-core:jar:0.20.2-cdh3u5, org.apache.hbase:hbase:jar:0.90.6-cdh3u5: Failure to find org.apache.hadoop:hadoop-core:jar:0.20.2-cdh3u5 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

Job configuration page shows only 20 first jobs

I use Trooper in Batch mode and I have more than 20 jobs. When I go to the Job page I can see my 27 with pagination (next button), but pagination is not visible in the Job Configuration page so I can see only the 20 first jobs.

I use v1.3.1, not tried 1.3.2-SNAPSHOT

Batch mode : navigation is slow

I use Trooper (v1.3.2-SNAPSHOT, v6) with 27 jobs, each one start at night.
After 3~4 days, web pages become slow to display, ~10s and sometimes more.
What VisualVM see when I click on the Job button in the menu :
capture
Is there a way to speed up trooper ?
Thanks

Feature to chain jobs

Hello Regunath,

I needed a feature to chain my jobs, here is how I implement it :

  • I created a listener to reschedule the next job :
    package xxx;

import java.util.Calendar;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.quartz.SchedulerException;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobExecutionListener;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.util.Assert;
import org.trpr.platform.batch.impl.quartz.SimpleScheduleRepository;
import org.trpr.platform.batch.impl.spring.SpringBatchComponentContainer;

public class TriggerNextJobListener implements JobExecutionListener, InitializingBean {
private static final Log logger = LogFactory.getLog(TriggerNextJobListener.class);
private String nextJobName;
private int delay = 10;

public void setDelay(int delay) {
    this.delay = delay;
}

public void setNextJobName(String nextJobName) {
    this.nextJobName = nextJobName;
}

@Override
public void beforeJob(JobExecution jobExecution) {
    // Nothing
}

@Override
public void afterJob(JobExecution jobExecution) {
    // Getting ApplicationContext
    ApplicationContext context = SpringBatchComponentContainer.getCommonBatchBeansContext();
    // Instance of bean SimpleScheduleRepsitory from ApplicationContext
    SimpleScheduleRepository rep = context.getBean(SimpleScheduleRepository.class);

    Calendar cal = Calendar.getInstance();
    cal.add(Calendar.SECOND, delay);

    try {
        rep.rescheduleJob(nextJobName, cal.getTime());
    } catch (SchedulerException e) {
        logger.error("Erreur lors de la replanification du job " + nextJobName, e);
    }

}

@Override
public void afterPropertiesSet() throws Exception {
    Assert.notNull(nextJobName, "'nextJobName' property value is required");
}

}

  • I override the SimpleScheduleRepository class to add these 2 methods :
    public void rescheduleJob(String jobName, Date scheduleDate) throws SchedulerException {
    Calendar calNow = Calendar.getInstance();
    calNow.add(Calendar.SECOND, 1);
    if (scheduleDate.before(calNow.getTime())) {
    throw new SchedulerException("Planification antérieure à l'instant t, planification annulée");
    }
    Scheduler sch = this.jobScheculer.get(jobName);
    if (sch == null) {
    throw new SchedulerException("Pas de planificateur pour ce job, créez un planificateur et un trigger pour pouvoir le replanifier");
    }
    Trigger oldTrigger = getTriggerFromScheduler(sch, jobName);
    SimpleTriggerBean newTrigger = new SimpleTriggerBean();
    newTrigger.setStartTime(scheduleDate);
    newTrigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY); // Il faut replanifier le job de sorte qu'il y ait toujours une nextFireDate
    newTrigger.setRepeatInterval(add1000yearsToDate(scheduleDate)); // On replanifie le job dans 1000 ans, pas de risque qu'il se relance
    newTrigger.setName(oldTrigger.getName());
    newTrigger.setGroup(oldTrigger.getGroup());
    newTrigger.setJobName(oldTrigger.getJobName());
    newTrigger.setJobGroup(oldTrigger.getJobGroup());
    sch.rescheduleJob(oldTrigger.getName(), oldTrigger.getGroup(), newTrigger);
    }

    private long add1000yearsToDate(Date date) {
    Calendar cal = Calendar.getInstance();
    cal.setTime(date);
    cal.add(Calendar.YEAR, 1000);
    return cal.getTimeInMillis() - date.getTime();
    }

I know that's not the best way to do this but maybe it can help other users who need this feature.
I think that it will be good if trooper can offer this feature (not necessarily my implementation), it's very userful.

Job execution order in batch mode

Hello Regunath,

As in Jobs page, is it possible to add an order in the Executions page ? I dont't find the order used and when job executions grows it is difficult to find a specific execution.

Thank you.

Bootstrap stop() causes JVM exit

Calling stop() on the Trooper Bootstrap running Batch profile in 'server' mode causes JVM to exit.
Steps to reproduce:

  1. Edit bootstrap.xml to change nature to 'server' instead of 'standalone'. Ignore if it is 'server' already.
  2. Run the Trooper batch profile bootstrap. E.g. in bootstrap.xml
  3. Open up JMX console, navigate to the Runtime bean and click "stop". Trooper JVM exits.

RabbitMQMessageConsumerImpl gives NPE after call to getQueueDepth

Tried updating the test program, RabbitMQMessagePublisherTest.java, to consume a message.

Did something like this, and getting Null Pointer Exception. The reason is that when "getQueueDepth" is called before "consumeString", the "createConnectionAndConsumer" method of RabbitConnectionHolder does not get called.

    while (true) {
        System.out.println("Messages in queue: " + consumer.getQueueDepth());
        try {
            String msg = consumer.consumeString();
            System.out.println("Consumed a message: " + msg);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

Exception text:

19:57:21.476 [main] ERROR o.t.p.i.i.m.RabbitMQMessageConsumerImpl - Error while consuming message from queue. Will try other configurations. Error is : null
java.lang.NullPointerException: null
at org.trpr.platform.integration.impl.messaging.RabbitMQMessageConsumerImpl.consume(RabbitMQMessageConsumerImpl.java:220) [classes/:na]
at org.trpr.platform.integration.impl.messaging.RabbitMQMessageConsumerImpl.consumeString(RabbitMQMessageConsumerImpl.java:112) [classes/:na]
at org.trpr.platform.integration.messaging.test.RabbitMQMessagePublisherTest.main(RabbitMQMessagePublisherTest.java:60) [test-classes/:na]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.