Schema-oriented message destination

机器学习模型服务化:从Notebook到高可用生产环境的工程实践 模型服务化(Model Serving)是将训练好的机器学习模型封装为稳定、可观测、可治理的在线API服务的关键环节,其核心在于解决从实验代码到生产软件的范式迁移——不再追求快速验证,而是保障SLA、弹性扩缩、故障自愈与全链路可观测性。技术原理涵盖模型加载优化(如ONNX格式统一)、推理时熔断降级、优雅卸载与GPU显存管理,并深度集成Kubernetes原生能力(Seldon Core声明式编排、Istio流量治理、Prometheus+OpenTelemetry可观测栈)。其技术价值体现在降低90%因隐形 阅读详情
Schema-oriented message destination

AUTHOR
======

Ricky Ho (rickyphyllis@hotmail.com)
08/28/2001


CONTEXT
=======

When a message producer send a message to a destination (queue or topic), he wants to make sure that he is sending messages to a destination where the consumers can understand. Similarly, when a message consumer receive a message from a destination, he wants to make sure that he can understand all messages he take from the destination.

PROBLEMS
========

In JMS, the producer and consumer are tightly coupled with the message structure. However, there is no relationship between the destination and the message structure. Therefore, the consumer application and producer application needs to agree upfront (at design time) what message structure will be produced or consumed.

(Problem 1):
There is NO standard way for a new producer app or consumer app to learn what message structure they should be used for a destination. They will try to look for existing design documents to find if they mention anything about the message structure. Nevertheless, the only reliable way is to look at source code from existing producer and consumer app. This process is error-prone.

(Problem 2):
If the consumer consumes a message from a queue with an unexpected structure. At best, it detects the message is not understandable and drops it, in this case the message is lost. At worst, the message with wrong structure will crash the consumer app. Well-written consumer applications will take the burden to code the message structure validation logic, resulting in undesirable complexity. Ideally, the message structure should have been verified before passing to the consumer application.

(Problem 3):
Whenever a change is needed for a message structure (usually initiated from one of the message producer), nightmare start. First, we need to trace all the destination where the new message (with the changed message structure) will go to. Second, for each of the destination, we need to trace all the consumer applications and make sure that they are changed apropriately to deal with the new message structure. This tracing can be very difficult when the consumer application dynamically subscribing and receiving from destinations. If we miss the upgrade for one consuming app, we are introducing problem 2.


SOLUTION
========

A destination should only accept one type of message with a particular message structure. The metadata associated with each destination should include the definition of this ONE message structure that it accepts.

Whenever a message is sent to a destination, the JMS container should verifies the message with the specified structure.

Whenever a change is made to a message structure, a new version of destination (by destination naming convention)is created, at the same time all existing consumer applications will received a callback method "onSchemaChange()". Now this new destination will only accept message with the new (changed) message structure. Old producer app without aware of the message structure change can keep sending message with old structure to the old destination which will be consumed by old consumer apps. Because, existing consumer apps will never receive the new message type until they explicitly change to the new destination, they won't break. This mechanism requires the producer and consumer applications to explicitly move to a new destination and accomodate the message structure changes at the same time.


CONSEQUENCE
===========

By enforcing the association between a destination with a message type. We can standardize the mechanism how the producer app and consumer app discover the correct message schema.

By introducing metadata of the destination, a producer app and consumer app can examine that at run time, and hence reducing design-time assumptions.

The destination versioning helps to prevent incompatibilities problems when schema changes.

4 replies in this thread Reply
Read more Schema-oriented message destination
Posted By: Gal Binyamini on August 29, 2001 in response to this message.
Some notes:
1. When a schema changes, how do you suppose the clients will start producing new valid versions? New schemas usually mean different data. In order to make clients that can adapt to new schemas on-the-fly you need a lot of technology, and this pattern alone won't help you at that (I belive some work is done in this direction in JXTA).
2. Having a callback to a client is *extremely* undersireable in message-based application. It makes strong coupling between consumers and producers, and should be avoided whenever possible. I think this alone rules out this particular strategy.
3. You have made no proposal as for the schema language to use, and I don't think any one can propose such language. Therefore I don't see a way for the JMS provider to do the validation for you. Besides, the fact is the JMS provider doesn't do the validation, so the current proposal is not a "design pattern" - it can't work with existing specs.

As I see it, this pattern comes down to: define the structure of the message in some language and before you start processing a message make sure it conforms to the definition.
This is generally what people do today, and I think it's more of a "good practice" than a "design pattern".
The parts about making this definition formal and available are again, IMHO, just good practice.

Note that in some areas such as XML messaging defining the input schema using a DTD/XML Schema is possible. Most such systems will support this notion.

Gal
0 replies in this thread Reply
Read more Schema-oriented message destination
Posted By: Ricky Ho on August 29, 2001 in response to this message.
Of course we verify the message structure using schema validation (in case of XML message) but there is no association between a JMS destination with an XML schema. This pattern suggest to associate the schema definition with the destination so that the validation can be done outside the consumer application (possibly by the JMS container).

My response to your 3 notes

1) The pattern doesn't advocate application (producer or consumer) needs to be adapt to new schema on the fly. Although the metadata of the destination allows this to happen by enabling introspection-style programming, it is not recommended because the code will become less readable (similar to using Java reflection API instead of regular method calls). The pattern actually enable the producer app and consumer app to upgrade their code (design-time, not run-time) in a controllable way so that new producer would never get a chance to talk to an old consumer.

2) Callback function is used extensively in JMS. Whenever a subscriber subscribe to a topic, it register a callback function "onMessage()" which will be called whether a message is delivered to that topic. Same for MessageDrivenBean, "callback" almost becomes a dominant case. Would you mind to elaborate more detail about the tight coupling scenario you mentioned.

3) For XML message, the Schema language will be XML Schema. For Map message, the Schema language will specify the list of key names. For Object message, the Schema language will specify the class name of the Java Object.

Best regards,
Ricky
2 replies in this thread Reply
Read more Schema-oriented message destination
Posted By: Giedrius Trumpickas on August 30, 2001 in response to this message.

I don't think that this design suggestion can be treated as pattern. It just design suggestion for MOM API.
In simple terms it sounds: messages version support in MOM and message routing to consumers depending on version.
0 replies in this thread Reply
Read more Schema-oriented message destination
Posted By: Gal Binyamini on August 30, 2001 in response to this message.
As you said, the association of schema definition with a destination is important at design time, not run time. I don't see a reason for letting the clients know about new schemas as they arrive unless they can adapt to them.
If you want a seperate service of notifying clients as new versions of the service get released, you can use a callback (with a topic) as you described. I don't see how this is specifically relevant to this pattern.

If choosing a schema language was that simple, JMS would have incorporated it. However, JMS is designed to be used in a variety of different ways, and validation may mean different things to differet people. When I validate a Map, I usually need to check the actual mapped values, not only that *some* value exists for them. I see no special reason why JMS should support your specific schemas rather than others. If you need these particular types of schemas, you can extend JMS (for instance, by providing a common base class for listeners).

If JMS will be extended to support XML messaging in specific (which isn't obvious), it may support XML Schemas.

Anyway, my point is not that what's described here is not a good design approach. It's simply not a design pattern, IMHO.

Regards
Gal
0 replies in this thread Reply
Read more Schema-oriented message destination
Posted By: Polina Alber on September 12, 2001 in response to this message.
Introduction of "schema-oriented message destination" comes against loosely coupled system approach. In addition a number of destinations can be limited per system. I think the easiest way to enforce message delivery to appropriate consumer is to use a message selector option and custom message properties settings ( like: proprietary message format type).
1 replies in this thread Reply
Read more Schema-oriented message destination
Posted By: Ricky Ho on September 13, 2001 in response to this message.
The unfortunate fact is, in current JMS, the producer and consumer code are "tightly coupled" with the message structure. Message selector doesn't help in this case because there is nothing preventing the producer code putting the right message properties but the wrong message type and crash the consumer code.

The solution is some schema checking needs to be done before the message get dispatched to the consumer. Therefore, we need to associate some schema information with the destination (queue/topic) to enable this kind of checking.

Ricky
0 replies in this thread Reply
Read more Schema-oriented message destination
Posted By: Peter Donald on September 16, 2001 in response to this message.
I am not sure this is strictly needed as part of the API or even the infrastructure. Names in JMS roughly corespond to ports in TCP/IP world.

The TCP/IP world has several "schemas" and generally they are associated with a port (though not necessarily). For instance the HTTP "schema" is associated with port 80, 8080 and a few others ontop of SSL.

If there was well known and published schemas then I think they could have well known and published names. However as I don't know of any organization that does such standardization shouldn't it just be a company internal policy?
1 replies in this thread Reply
Read more Schema-oriented message destination
Posted By: Ricky Ho on September 16, 2001 in response to this message.
Peter,

There are some interesting difference ...
1) Port 80 is well-known, but not any JMS destination.
2) HTTP parameters has a well-published encoding standard, but JMS doesn't.

In fact, HTTP suffer from a similar problem, but to a lesser degree, because ...

a) HTTP has a different programming model. Typically the Servlet will extract only the parameters it expect, so whatever it doesn't expect will simply be ignored. For those it expects, the Servlet code will check if they are "null" or any application specific test. Of course in JMS, such checking responsibility can be put into the receiver code also, but having another layer to enforce this is cleaner, because the checking is declared externally, rather than buried into the Java code.

b) HTTP is a sync protocol, so whatever the sender immediately aware of any problem that has occured and deal with it immediately. However, exception handling in an async protocol is very clumsy. The default exception handling is just abort the receiving side transaction and keep re-dispatching the wrong message. Usually the solution requires some more complex async notification and sometime manual intervention. It will be much better if the checking can be done by the message broker when the sender sends the message. (the interaction between the sender and message broker is usually sync).

Best regards,
Ricky
0 replies in this thread
Ubuntu 20.04 安装 MongoDB 常见失败原因与 systemd 服务配置指南 MongoDB 是一种面向文档的 NoSQL 数据库,其服务在 Linux 系统中依赖 init 系统进行生命周期管理。在 Ubuntu 20.04 这一以 systemd 为唯一 init 系统的 LTS 版本中,官方 MongoDB 包默认仅提供 systemd service unit 文件,但不会自动注册或激活——这导致 `systemctl start mongod` 报错 `Unit not found` 或 `PID 1 is not systemd`。技术价值在于厘清 APT 包管理、sys 阅读详情

相关推荐

处理 moviepy 音视频剪辑中的 ValueError: assignment destination is read-only 错误

这两种方法都可以解决 “assignment destination is read-only” 错误。它们的原理是创建一个新的图像数组,并对新数组进行修改,而不是直接修改只读的传递给函数的图像数组。这个错误的出现通常是因为在自定义的图像处理函数中,尝试对图像数组进行修改,而传递给该函数的图像数组是只读的。请根据您的具体需求选择其中一种方法,并根据需要在自定义的图像处理函数中进行修改。

qq_37934722的博客 1032

针对PIL/Image报错:ValueError: assignment destination is read-only 的解决方案

原来的代码: import numpy as np from PIL import Image img_new = Image.new("RGB",(800,800),(0,0,0)) #新建一个黑色背景 labelmatrix = np.asarray(img_new) labelmatrix[:,:,0] = 255 运行时在第六行出现报错: ValueError: assignment destination is read-only . 解决方案: 加一个.copy() 修改后的代码: impo

weixin_44316581的博客 4171

MoviePy音视频剪辑中headblur函数的ValueError assignment destination is read-only问题及解决办法

这是由于该函数内部使用了numpy数组的结构,并且返回值直接为numpy数组,而numpy数组不允许修改元素。但是事实上,headblur函数中需要对该数组进行一些计算和修改。因此,我们需要将该返回值转化为可修改的格式。其中,np.uint8表示将结果转化为8位无符号整数类型,具体的数据类型可以根据需要进行修改。这样就可以在保证程序运行正确性的同时,对返回值进行修改和操作了。在使用MoviePy进行音视频剪辑时,可能会用到headblur函数来实现模糊效果。

BUG?不存在的! 811

报错:ValueError: assignment destination is read-only 的解决方案

【代码】报错:ValueError: assignment destination is read-only 的解决方案。

知识搬运者 1708

【信息科学与工程学】【数据中心】第三十五篇 云计算数据中心的学科知识04

编号学科(课程)核心知识点在云计算/云存储/云网络/云安全/云MaaS中的作用代表教材/资料/论文 + 数学方程式列表工业界应用D1421​云原生数据库:TiDB​HTAP(混合事务/分析处理)、分布式SQL、水平扩展、强一致(Raft)、自动故障恢复、与MySQL兼容、TiFlash列式引擎提供弹性扩展的分布式数据库;支撑高并发在线交易与实时分析教材:《TiDB in Action》PingCAP(2020) 论文:《TiDB: A Raft-based HTAP Database》(2017)

weixin_49199313的博客 802

MoviePy音视频剪辑:解决headblur函数中的“ValueError: assignment destination is read-only“问题

MoviePy音视频剪辑:解决headblur函数中的"ValueError: assignment destination is read-only"问题近年来,音视频剪辑在数字媒体领域中扮演着重要角色。Python中的MoviePy库为我们提供了便捷的工具,用于处理和编辑音视频文件。其中,headblur函数可以用于模糊视频中的头部区域,但在使用该函数时,有时会遇到"ValueError: assignment destination is read-only"错误。

PixelShadeZ的博客 428

ValueError:assignment destination is read-only https://ask.csdn.net/questions/757782

关于object detection运行视频检测代码出现报错:ValueError:assignment destination is read-only 我参考博主 withzheng的博客:https://blog.csdn.net/xiaoxiao123jun/art...

ChengChengCheng的博客 8586

ESP32S3开发实战:从Vscode+IDF环境配置到OpenOCD单步调试全流程

本文详细介绍了ESP32S3开发环境的完整搭建流程,重点讲解如何在Vscode中配置ESP-IDF开发框架,并利用OpenOCD工具实现硬件单步调试。内容涵盖从环境准备、工程创建、代码烧录到高级调试技巧的全方位实战指南,旨在帮助开发者快速掌握ESP32S3的高效开发与调试方法。

weixin_29168813的博客 219

Schema-oriented message destination (转)

Schema-oriented message destination (转)[@more@]Schema-oriented message destination AUTHOR ====== Ricky Ho (rickyph...

csd3176的博客 332

激光可燃气体传感器DIY指南:从TDLAS原理到STM32实战(附代码)

本文详细介绍了如何DIY激光可燃气体传感器,从TDLAS原理到STM32实战,包括硬件选型、光路搭建、电子系统设计和嵌入式软件开发。通过TDLAS技术实现高灵敏度甲烷检测,适合工业安全和环境监测应用。附有完整代码和实用调试技巧,帮助开发者快速掌握光学气体检测技术。

fanta的博客 462

详解GPU显存和batch size的关系

GPU显存、规格指标;神经网络训练,显存占用

orangerfun的博客 6226

MongoDB文档模型本质:从松散模式到聚合管道的数据治理哲学

文档数据库是一种以JSON-like结构为基本存储单元的NoSQL数据模型,其核心原理在于将业务实体封装为自包含、可索引、可部分更新的BSON文档,从而摆脱关系型数据库中预定义Schema与多表JOIN的刚性约束。这种设计赋予了系统天然的模式灵活性与水平扩展能力,技术价值体现在显著降低高频迭代场景下的数据演化成本——如电商SKU属性动态扩展、IoT设备字段实时新增等。典型应用场景包括内容管理系统、用户画像服务、实时分析看板及微服务间松耦合数据交换。本文深入解析MongoDB作为文档数据库代表的建模思想、聚合

weixin_34026276的博客 307

【Stata双重差分模型】双重差分DID的具体操作步骤

本案例将详细阐述如何使用双重差分法进行实证分析,并展示具体的STATA操作代码。

a519573917的博客 2万+

3个实战技巧解决Dify工作流Agent与工具调用配置难题

在Dify工作流开发中,Agent与工具调用是实现智能自动化的核心能力,但许多中级开发者在配置过程中常遇到工具选择困难、参数传递错误、Agent策略配置不当等问题。本文将采用"挑战场景 → 诊断突破 → 解决方案 → 实战验证"的四步法,帮助您系统掌握Dify中Agent与工具调用的配置精髓,提升工作流智能化水平。 ## 场景一:多轮对话Agent配置的迷雾挑战 ### 挑战场景 当您需要构建

gitblog_01085的博客 381

全球气候模式降尺度方法总结及其代码实现

简介总结各类型气候模式降尺度方法

WW、forever的博客 1万+

手把手教你学Simulink--基于新型通信技术集成的场景实例:无人机利用激光通信实现高速率数据传输

摘要: 本文基于Simulink搭建无人机激光通信仿真系统,解决传统射频通信带宽不足问题。系统通过五层架构(发射机、信道、PAT系统、接收机、性能分析)实现Gbps级高速传输,重点建模大气衰减(雾/雨)、光束发散、PAT精跟踪(Stateflow+PID控制)等核心模块。仿真结果显示:晴天链路可达2.5Gbps(BER 1e-8),浓雾下链路中断,验证了雾是主要性能限制因素。案例涵盖调制方式选择、动态环境仿真及3D可视化,为无人机高速数据传输提供可扩展的仿真框架,并指出混合FSO/RF、AI-PAT等优化方

MHD0815的博客 192

moviepy音视频剪辑VideoClip类fl_image方法image_func报错ValueError: assignment destination is read-only解决办法

☞ ░ 前往老猿Python博文目录 ░ moviepy音视频剪辑模块的视频剪辑基类VideoClip的fl_image方法用于进行对剪辑帧数据进行变换。 调用语法:fl_image(self, image_func, apply_to=None)。 其中参数image_func用于对帧数据进行变换,可以调用moviepy提供的相关方法,也可以自己实现,但自己实现时可能在运行时报错:ValueError: assignment destination is read-only 这是因为image_func

老猿Python 2777

JavaScript实现斗地主(附完整源码)

JavaScript实现斗地主(附完整源码)

希望我的博客,能帮上你解决学习中工作中所遇到的问题 1531

gplearn出现 assignment destination is read-only

gplearn assignment destination is read-only

蔡金航的博客 896

基于Simulink进行步进电机的重复控制仿真建模

重复控制概述目的:通过引入一个周期延迟环节来补偿系统的周期性误差,从而提高系统对周期性参考信号或扰动的跟踪性能。方法内部模型原理:在控制器中嵌入一个与周期性信号相关的模型(例如周期延迟环节),以实现对周期性误差的零稳态误差控制。滤波器设计:为了避免高频噪声放大,通常会在重复控制器中加入低通滤波器。优势对周期性信号具有良好的跟踪性能。不需要精确的数学模型即可实现高性能控制。挑战:需要合理设计重复控制器的参数以避免系统不稳定。

amy_mhd的博客 276

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

python的head函数输不出数据_moviepy音视频剪辑:headblur函数遇到的ValueError assignment destination is read-only问题及解决办法...

一、运行环境运行环境如下:python版本:3.7opencv-python版本:4.2.0.34numpy版本:1.19.0二、错误案例代码及报错信息使用如下代码调用headblur进行人脸跟踪打马赛克:if __name__ == '__main__':movie_in = sys.argv[1]if len(sys.argv) == 3: #参数指定的视频文件名subclip_s = flo...

weixin_29720641的博客 417

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

moviepy音视频剪辑:headblur函数遇到的ValueError assignment destination is read-only问题及解决办法

def headblur(clip,fx,fy,r_zone,r_blur=None): if r_blur is None: r_blur = 2*r_zone/3 r_blur = int(2*r_zone/3)#added by jwp,TypeError: integer argument expected, got float def fl(gf,t): im = gf(t) h,w,d = im.shape

老猿Python 1640

InTheHand.Net.Personal+BlueTooth4,蓝牙开发

项目中有蓝牙开发的必备dll,现在网上相关的文档博客不少,有的说的多有的说少,但是却很少有这两个dll,分享一下。

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

《Spring揭秘》读书笔记 2:Spring AOP

Spring AOP。

拉里小猪的博客 612

Python Numpy.ndarray ValueError:assignment destination is read-only

参考:http://stackoverflow.com/questions/13572448/change-values-in-a-numpy-array 问题:img为numpy.ndarray,在使用img[img<0]=0 语句时,报错ValueError:assignment destination is read-only (同一代码在win、ubuntu下没问题,而在cent...

豆芽菜 5317
上一篇: Coarse Grained BMP beans with Dependent Value Objects
下一篇: Schema Value Object
xxcc
博客等级 码龄26年 1粉丝 86原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址