简体   繁体   中英

How do I pass a List<int> from one job to another?

I'd like to create a workflow so that the first job gets some ids from a database and passes them to the subsequent jobs. It's expensive to get the ids so I'd prefer to do it only once in the master job. The other jobs should just modify the data in their own way.

I've found a similar question about how this can be achieved: Quartz.Net and passing data between chaining jobs however I'm not sure whether this is a good idea because the documentation suggests otherwise:

Only store primitive data types (including strings) in JobDataMap to avoid data serialization issues short and long-term.

Quartz.NET - Best Practices

What can happen if I put a List<id> on to the JobDataMap ? Is there another way for doing this?

You are right in stating that List<int> is not primitive. Rather, it is a finite set of primitive values. However, since string s are considered to be primitive, you can encode your list into a JSON string , so it will be primitive.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM