-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support of parsing job body format according to job id version
Currently, we store the job payload in Redis without any encoding, so it's possible to extend more fields for job, like attributes etc. To mitigate this issue, we introduce the version prefix for the job id to identify different job payload formats. And use the length to tell if it's a legacy id or not since the ulid's id is a fixed length string(26 chars). That said, we will return the value as job body directly if the length is 26. Otherwise, decode it as JSON format. And to avoid introducing breaking changes during the upgrade stage, we add a new HTTP header: Enable-Job-Version to enable this feature. The new job format would be enabled only if the header `Enable-Job-Version: yes` was explicitly passed in the publish request. So that we can smoothly support new job payload format by upgrading the server first, and enable it in client side since then.
- Loading branch information
Showing
7 changed files
with
154 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters