René's URL Explorer Experiment


Title: Mismatch between MessagePack str and Java String · Issue #890 · msgpack/msgpack-java · GitHub

Open Graph Title: Mismatch between MessagePack str and Java String · Issue #890 · msgpack/msgpack-java

X Title: Mismatch between MessagePack str and Java String · Issue #890 · msgpack/msgpack-java

Description: Overview The msgpack specification defines the str types as: Str format family stores a byte array But in Java: The String class represents character strings. The difference here is a msgpack str value can carry any arbitrary array of by...

Open Graph Description: Overview The msgpack specification defines the str types as: Str format family stores a byte array But in Java: The String class represents character strings. The difference here is a msgpack str v...

X Description: Overview The msgpack specification defines the str types as: Str format family stores a byte array But in Java: The String class represents character strings. The difference here is a msgpack str v...

Opengraph URL: https://github.com/msgpack/msgpack-java/issues/890

X: @github

direct link

Domain: redirect.github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Mismatch between MessagePack str and Java String","articleBody":"### Overview\nThe msgpack specification [defines the `str` types](https://github.com/msgpack/msgpack/blob/master/spec.md#str-format-family) as:\n\u003e Str format family stores a byte array\n\nBut [in Java](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html):\n\u003e The String class represents character strings.\n\nThe difference here is a msgpack str value can carry **any arbitrary array of bytes** while Java **enforces a character set** encoding on its String objects. This means that a msgpack str allows byte arrays that cannot be properly decoded to Java Strings.\n\n### Why does this matter?\nAs the popularity of Redis grows beyond mere caching, Redis functions become an important feature for performing multiple operations in a single atomic unit of work. The definition of the FCALL/FCALL_RO commands have a list of keys and arguments that are order-based and consequently strongly couple the function code to the calling code. This can be alleviated greatly by using msgpack to send complex objects to a Redis function as its argument(s).\n\nRedis functions bring together the Lua programming language for server-side functions with the cmsgpack library for encoding and decoding data. Java enters the picture with multiple libraries including Spring Data Redis, Jedis, and Lettuce. \nTo Redis, every key and value is a byte array, so a client may store a msgpack data structure as the value for a key or hash entry.\nWhen this value is retrieved via a Lua script, it is treated by Lua as a string-- Lua has no byte[] data type because a string in Lua, just like in msgpack, can contain any arbitrary array of bytes.\n\nBut when Jackson deserializes this str value it decodes it into a String. At this point we lose fidelity because the byte array behind the Lua string and msgpack str does not match the byte array behind the Java String-- Java has converted the byte[] into a String using a character encoding that has character substitution logic to shoehorn the invalid data into the String.\n\n### So how can this be fixed?\n\nIt seems easy-- the MessagePackParser should read every string object just like a binary object-- into a byte[]. Then when Jackson matches this to a data type, for any String objects it can proceed using the same conversion logic as it currently employs by default; but when the target of deserialization has a byte[] data type, the raw bytes can be supplied directly.\n\nThis would allow what is currently not possible using Jackson deserialization of msgpack objects -- reading in data from Redis values that do not correspond to valid Java Strings. \n\nOur current use case looks like the following:\n- Java code produces a value to store in Redis and does so using Spring Data Redis. The Redis Template uses MessagePackRedisSerializer to store any arbitrary object as a msgpack string of bytes.\n- We need to read many of these objects to process a single request, so we are using Lua to read multiple values from multiple hashes. As the values are read, they become Lua strings. Once all objects are collected, we use cmsgpack to pack the result and reply to the Java layer.\n- The Java layer using jackson-dataformat-msgpack deserializes the values but receives incorrect byte[] after unpacking the response because it gets converted to a String first and then to byte[].\n\n\n\n","author":{"url":"https://github.com/thx01138","@type":"Person","name":"thx01138"},"datePublished":"2025-06-09T16:51:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/890/msgpack-java/issues/890"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:479aaca7-6cc7-079d-4984-93012b54bee4
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id91CC:3F7705:17DD6EA:20ACA84:6A53E546
html-safe-nonce91ac0d2094dd9cf1b089b6359a48df7ebac731e2494e5bd4ab06fe57d4976426
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MUNDOjNGNzcwNToxN0RENkVBOjIwQUNBODQ6NkE1M0U1NDYiLCJ2aXNpdG9yX2lkIjoiNjM5NDk3NzU2ODQ1NDYwMDAwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc59f9502f3850d355503aa580ec66fd735c34ff1bfc8db006bdb96f9b1810988
hovercard-subject-tagissue:3130853302
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/msgpack/msgpack-java/890/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8997f0ccc279e819a5eecb3e0fb99c6d2e0d856a0a940681439c67283e4f5047/msgpack/msgpack-java/issues/890
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8997f0ccc279e819a5eecb3e0fb99c6d2e0d856a0a940681439c67283e4f5047/msgpack/msgpack-java/issues/890
og:image:altOverview The msgpack specification defines the str types as: Str format family stores a byte array But in Java: The String class represents character strings. The difference here is a msgpack str v...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamethx01138
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
go-importgithub.com/msgpack/msgpack-java git https://github.com/msgpack/msgpack-java.git
octolytics-dimension-user_id198264
octolytics-dimension-user_loginmsgpack
octolytics-dimension-repository_id1971346
octolytics-dimension-repository_nwomsgpack/msgpack-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1971346
octolytics-dimension-repository_network_root_nwomsgpack/msgpack-java
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release07a982c1d40157c619b364352b704c3ce66bb332
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://redirect.github.com/msgpack/msgpack-java/issues/890#start-of-content
https://redirect.github.com/
Sign in https://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmsgpack%2Fmsgpack-java%2Fissues%2F890
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmsgpack%2Fmsgpack-java%2Fissues%2F890
Sign up https://redirect.github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=msgpack%2Fmsgpack-java
Reloadhttps://redirect.github.com/msgpack/msgpack-java/issues/890
Reloadhttps://redirect.github.com/msgpack/msgpack-java/issues/890
Reloadhttps://redirect.github.com/msgpack/msgpack-java/issues/890
Please reload this pagehttps://redirect.github.com/msgpack/msgpack-java/issues/890
msgpack https://redirect.github.com/msgpack
msgpack-javahttps://redirect.github.com/msgpack/msgpack-java
Notifications https://redirect.github.com/login?return_to=%2Fmsgpack%2Fmsgpack-java
Fork 323 https://redirect.github.com/login?return_to=%2Fmsgpack%2Fmsgpack-java
Star 1.5k https://redirect.github.com/login?return_to=%2Fmsgpack%2Fmsgpack-java
Code https://redirect.github.com/msgpack/msgpack-java
Issues 60 https://redirect.github.com/msgpack/msgpack-java/issues
Pull requests 5 https://redirect.github.com/msgpack/msgpack-java/pulls
Actions https://redirect.github.com/msgpack/msgpack-java/actions
Projects https://redirect.github.com/msgpack/msgpack-java/projects
Wiki https://redirect.github.com/msgpack/msgpack-java/wiki
Security and quality 1 https://redirect.github.com/msgpack/msgpack-java/security
Insights https://redirect.github.com/msgpack/msgpack-java/pulse
Code https://redirect.github.com/msgpack/msgpack-java
Issues https://redirect.github.com/msgpack/msgpack-java/issues
Pull requests https://redirect.github.com/msgpack/msgpack-java/pulls
Actions https://redirect.github.com/msgpack/msgpack-java/actions
Projects https://redirect.github.com/msgpack/msgpack-java/projects
Wiki https://redirect.github.com/msgpack/msgpack-java/wiki
Security and quality https://redirect.github.com/msgpack/msgpack-java/security
Insights https://redirect.github.com/msgpack/msgpack-java/pulse
Mismatch between MessagePack str and Java Stringhttps://redirect.github.com/msgpack/msgpack-java/issues/890#top
https://github.com/thx01138
thx01138https://github.com/thx01138
on Jun 9, 2025https://github.com/msgpack/msgpack-java/issues/890#issue-3130853302
defines the str typeshttps://github.com/msgpack/msgpack/blob/master/spec.md#str-format-family
in Javahttps://docs.oracle.com/javase/8/docs/api/java/lang/String.html
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.