batchee-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Sandtner <reinhard.sandt...@gmail.com>
Subject Re: JobLevel Listeners
Date Wed, 24 Feb 2016 08:45:36 GMT
sounds really good to me :-D

but the „on=…“-attribute could not be done before the jbatch-spec 1.1? as it is not
in the schema yet - or am i missing something?

what are the next steps?

do we want to enable the listener-support via batchee.properties? if so, i’ll create a JIRA
in batchee an start working on this task -> end of this week
shall i file a spec issue (too) -> enhanced with the "on=…“ attribute?

lg
reini


> Am 24.02.2016 um 08:28 schrieb Romain Manni-Bucau <rmannibucau@gmail.com>:
> 
> Yep but you can control your listeners with JobContext to skip them or not.
> 
> That said agree having them by job would be easy and nice.
> 
> Also the good thing with CDI - guess you use it ;) - is the in/out property
> binding is not that relevant since you just pass your state in the injected
> beans (or job context if really needed).
> 
> Just to give another thought to that: tasks are identified so we could
> define global listeners with regex:
> 
> <job id=„myJob“>
>    <listeners>
>        <listener ref=„myUserStepListener“ on="stepT.*" /> <!-- stepOne
> doesn't worth it -->
>   </listeners>
> 
>   <step id=„stepOne“>
>    ….
>   </step>
> 
>   <step id=„stepTwo“>
>    ….
>   </step>
> 
>   <step id=„stepThree“>
>    ….
>   </step>
> </job>
> 
> 
> 
> 
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau>
|
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
> 
> 2016-02-24 8:20 GMT+01:00 Mark Struberg <struberg@yahoo.de>:
> 
>> But that would register the listeners for ALL jobs running on this box,
>> right?
>> This is great for some infrastructure integration, but you cannot define
>> it per job.
>> Or even make the job bring his own listeners.
>> 
>> LieGrue,
>> strub
>> 
>>> Am 23.02.2016 um 12:27 schrieb Romain Manni-Bucau <rmannibucau@gmail.com
>>> :
>>> 
>>> org.apache.batchee.step.listeners.before and
>>> org.apache.batchee.step.listeners.after?
>>> 
>>> 
>>> 
>>> 
>>> Romain Manni-Bucau
>>> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
>>> <http://rmannibucau.wordpress.com> | Github <
>> https://github.com/rmannibucau> |
>>> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
>>> <http://www.tomitribe.com>
>>> 
>>> 2016-02-23 12:20 GMT+01:00 Reinhard Sandtner <
>> reinhard.sandtner@gmail.com>:
>>> 
>>>> Hey folks,
>>>> 
>>>> i’m currently struggling with listeners ;-)
>>>> 
>>>> i have a batch-job with various numbers of steps…
>>>> i need a stepScopeListener and an itemWriteListener for all steps in
>> this
>>>> job
>>>> 
>>>> wouldn’t it be a good idea to be able to do something like
>>>> 
>>>> <job id=„myJob“>
>>>>   <listeners>
>>>>       <listener ref=„myUserStepListener“ /> <!— just to get
the user in
>>>> a thread local —>
>>>>       <listener ref=„myItemWriterListener“ /> <!— just to
get my
>>>> ConstraintViolationException printed with the right message —>
>>>>  </listeners>
>>>> 
>>>>  <step id=„stepOne“>
>>>>   ….
>>>>  </step>
>>>> 
>>>>  <step id=„stepTwo“>
>>>>   ….
>>>>  </step>
>>>> 
>>>>  <step id=„stepThree“>
>>>>   ….
>>>>  </step>
>>>> </job>
>>>> 
>>>> i know the spec says only JobListeners can be specified as a job level
>>>> listener but we could add a property to enable this feature.
>>>> and of course i know its possibly to specify a listener via
>>>> batchee.properties globally for all batch jobs. but i need it only  for
>> a
>>>> number of batch jobs and not globally.
>>>> 
>>>> with the current implementation i’ve to define my listener separately
>> for
>>>> each step… it’s not that bad but define my listeners once would be
>> easier
>>>> in this case.
>>>> 
>>>> wdyt?
>>>> 
>>>> lg
>>>> reini
>> 
>> 


Mime
View raw message