- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们在测试环境中使用嵌入式 Glassfish Server。我们使用 org.glassfish.embeddable.CommandRunner
接口(interface)来执行管理任务(即,我们使用标准独立 Glassfish 服务器使用 asadmin
执行的操作)
例子:
GlassFish glassfish = GlassFishRuntime.bootstrap( bp ).newGlassFish( gfp );
CommandRunner commandRunner = glassfish.getService( CommandRunner.class );
commandRunner.run(
"create-jms-resource",
"--restype",
"javax.jms.Queue",
"SOME_QUEUE_NAME"
);
现在我可以在命令行上使用 imqcmd
设置队列选项。例如
imqcmd -u admin -passfile ../password.txt update dst -n SOME_QUEUE_NAME -t q -o maxBytesPerMsg=-1 -f
有没有办法通过嵌入式 Glassfish 服务器实现同样的目标?
最佳答案
而不是使用 imqcmd
, 您可以使用 asadmin
子命令 create-jmsdest
创建 JMS 物理目标。
来自documentation在 create-jmsdest
:
Typically, you use the
create-jms-resource
subcommand to create a JMS destination resource that has a Name property that specifies the physical destination. The physical destination is created automatically when you run an application that uses the destination resource. Use thecreate-jmsdest
subcommand if you want to create a physical destination with non-default property settings.
如果您没有为 create-jms-resource
指定名称属性,物理目标的名称与目标资源同名(将 JNDI 名称中的任何正斜杠替换为下划线)。
因此,asadmin
您要运行的命令例如:
create-jms-resource --restype javax.jms.Queue org/example/foo/SomeQueue
create-jmsdest --desttype queue --property maxBytesPerMsg=-1:maxTotalMsgBytes=-1 org_example_foo_SomeQueue
请注意(与 imqcmd update dst
不同)create-jmsdest
如果资源已经存在,则不会更新属性。因此,您不应在这两个命令之间启动您的应用程序,否则会自动创建具有默认属性的资源。
如果您必须更新属性,您可以先使用例如删除物理目标asadmin delete-jmsdest org_example_foo_SomeQueue
.
关于glassfish - 嵌入式 Glassfish 和 `imqcmd`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9886031/
我们在测试环境中使用嵌入式 Glassfish Server。我们使用 org.glassfish.embeddable.CommandRunner 接口(interface)来执行管理任务(即,我们
我是 JMS 的新手,有以下问题: 我希望清除我在 glassfish JMS 队列中创建的所有 JMS 消息。 我找到了两个命令来做同样的事情 asadmin flush-jmsdest --de
我是一名优秀的程序员,十分优秀!