- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 WildFly 10.1..0.Final,我想使用 STOMP over WebSocket 连接 JavaScript 客户端。我正在使用 stomp.js。 WildFly 包括 Apache ActiveMQ Artemis Message Broker 版本 1.1.0.wildfly-017。
首先,我使用 add-user.bat 添加了一个名为“myguest”的用户。该用户是“应用程序用户”。
接下来,我尝试了许多不同的方法来配置主题和安全设置。请检查我尝试配置主题的不同方式。都不起作用。
我尝试创建“jms.topic.chat”主题和一些变体。不工作。
我的standalone-full.xml是:
...
<subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
<server name="default">
<security-setting name="#">
<role name="guest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>
<role name="myguest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>
</security-setting>
<security-setting name="jms.topic.chat">
<role name="myguest" send="true" consume="true" create-durable-queue="true" delete-durable-queue="true" create-non-durable-queue="true" delete-non-durable-queue="true" manage="true"/>
<role name="guest" send="true" consume="true" create-durable-queue="true" delete-durable-queue="true" create-non-durable-queue="true" delete-non-durable-queue="true" manage="true"/>
</security-setting>
<security-setting name="topic.chat">
<role name="myguest" send="true" consume="true" create-durable-queue="true" delete-durable-queue="true" create-non-durable-queue="true" delete-non-durable-queue="true" manage="true"/>
<role name="guest" send="true" consume="true" create-durable-queue="true" delete-durable-queue="true" create-non-durable-queue="true" delete-non-durable-queue="true" manage="true"/>
</security-setting>
<security-setting name="jms.topic.chat2">
<role name="myguest" send="true" consume="true" create-durable-queue="true" delete-durable-queue="true" create-non-durable-queue="true" delete-non-durable-queue="true" manage="true"/>
<role name="guest" send="true" consume="true" create-durable-queue="true" delete-durable-queue="true" create-non-durable-queue="true" delete-non-durable-queue="true" manage="true"/>
</security-setting>
<security-setting name="topic.chat2">
<role name="myguest" send="true" consume="true" create-durable-queue="true" delete-durable-queue="true" create-non-durable-queue="true" delete-non-durable-queue="true" manage="true"/>
<role name="guest" send="true" consume="true" create-durable-queue="true" delete-durable-queue="true" create-non-durable-queue="true" delete-non-durable-queue="true" manage="true"/>
</security-setting>
<address-setting name="#" dead-letter-address="jms.queue.DLQ" expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760" page-size-bytes="2097152" message-counter-history-day-limit="10"/>
<http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/>
<http-connector name="http-connector-throughput" socket-binding="http" endpoint="http-acceptor-throughput">
<param name="batch-delay" value="50"/>
</http-connector>
<in-vm-connector name="in-vm" server-id="0"/>
<http-acceptor name="http-acceptor" http-listener="default"/>
<http-acceptor name="http-acceptor-throughput" http-listener="default">
<param name="batch-delay" value="50"/>
<param name="direct-deliver" value="false"/>
</http-acceptor>
<!-- I create it for Websocket -->
<remote-acceptor name="websocket-stomp" socket-binding="netty-ws"/>
<in-vm-acceptor name="in-vm" server-id="0"/>
<jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/>
<jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/>
<jms-queue name="chat" entries="java:jboss/exported/topic/chat"/>
<jms-queue name="chat2" entries="java:jboss/topic/chat2"/>
<jms-queue name="chat3" entries="java:/topic/chat" durable="false"/>
<jms-queue name="chat4" entries="java:/topic/chat4"/>
<connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/>
<connection-factory name="RemoteConnectionFactory" entries="java:jboss/exported/jms/RemoteConnectionFactory" connectors="http-connector"/>
<pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/>
</server>
</subsystem>
...
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
<socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
<socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
<socket-binding name="http" port="${jboss.http.port:8080}"/>
<socket-binding name="https" port="${jboss.https.port:8443}"/>
<socket-binding name="iiop" interface="unsecure" port="3528"/>
<socket-binding name="iiop-ssl" interface="unsecure" port="3529"/>
<socket-binding name="txn-recovery-environment" port="4712"/>
<socket-binding name="txn-status-manager" port="4713"/>
<!-- This is created for me: -->
<socket-binding name="netty-ws" port="61614" fixed-port="false"/>
<outbound-socket-binding name="mail-smtp">
<remote-destination host="localhost" port="25"/>
</outbound-socket-binding>
</socket-binding-group>
这是 HTML 客户端:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>STOMP over Websockets to HornetQ</title>
<!-- Bootstrap -->
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
.connectionconfig input {
width: 100%;
}
</style>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="js/sockjsclient/dist/sockjs-1.1.1.js"></script>
<script src="js/stomp/stomp.js"></script>
<script type="text/javascript">
var idClient = 1; // 1,2,3,...
var clientName = "cliente"+idClient; // cliente1, cleinte2, cliente3, ...
var destination = $('#destination').val();
var stompClient = null;
function connect() {
var url = $('#connect_URL').val();
var login = $('#connect_loging').val();
var password = $('#connect_password').val();
destination = $('#destination').val();
console.log(url+" "+login+" "+password+" "+destination);
stompClient = Stomp.client(url);
//stompClient.connect({}, function(frame) {
stompClient.connect(login,password, function(frame) {
setConnected(true);
console.log('Connected: ' + frame);
stompClient.subscribe(destination, function(messageOutput) {
if (messageOutput.body) {
showMessageOutput(JSON.parse(messageOutput.body));
} else {
console.log("got empty message");
}
});
});
}
function setConnected(connected) {
document.getElementById('connect').disabled = connected;
document.getElementById('disconnect').disabled = !connected;
document.getElementById('conversationDiv').style.visibility
= connected ? 'visible' : 'hidden';
document.getElementById('response').innerHTML = '';
}
function disconnect() {
if(stompClient != null) {
stompClient.disconnect();
}
setConnected(false);
console.log("Disconnected");
}
function sendMessage() {
var from = document.getElementById('from').value;
var text = document.getElementById('text').value;
stompClient.send("/app/chat.private", {},
JSON.stringify({'from':from, 'text':text}));
}
function showMessageOutput(messageOutput) {
var response = document.getElementById('response');
var p = document.createElement('p');
p.style.wordWrap = 'break-word';
p.appendChild(document.createTextNode(messageOutput.from + ": "
+ messageOutput.text + " (" + messageOutput.time + ")"));
response.appendChild(p);
}
$( document ).ready(function() {
// E.G. Cliente 1, Cliente 2, etc
$("#clientIdSpan").html(idClient);
disconnect();
$("#from").val(clientName); // cleinte1, cleinte2, etc..
});
</script>
</head>
<body>
<noscript><h2>Enable Java script and reload this page to run Websocket Demo</h2></noscript>
<h1>Cliente <span id="clientIdSpan">x</span></h1>
<div>
<div class="connectionconfig">
<dl>
<dt><label for="connect_URL">Server URL</label></dt>
<dd><input type="text" id="connect_URL" placeholder="ws://..." value="ws://localhost:61614/stomp"></dd>
<dt><label for="connect_loging">Loging</label></dt>
<dd><input type="text" id="connect_loging" placeholder="User loging: sergio o guest" value="myguest"></dd>
<dt><label for="connect_password">Password</label></dt>
<dd><input type="text" id="connect_password" placeholder="User passwor" value="myguest"></dd>
<dt><label for="destination">Destination</label></dt>
<dd><input type="text" id="destination" placeholder="Destination" value="jms.topic.chat"></dd>
<dt><label for="from">Nickname</label></dt>
<dd><input type="text" id="from" placeholder="Choose a nickname"/></dd>
</dl>
</div>
<br />
<div>
<button id="connect" onclick="connect();">Connect</button>
<button id="disconnect" disabled="disabled" onclick="disconnect();">
Disconnect
</button>
</div>
<br />
<div id="conversationDiv">
<input type="text" id="text" placeholder="Write a message..."/>
<button id="sendMessage" onclick="sendMessage();">Send</button>
<p id="response"></p>
</div>
</div>
</body>
</html>
Chrome 的控制台输出是:
Opening Web Socket...
stomp.js:145 Web Socket Opened...
stomp.js:145 >>> CONNECT
login:myguest
passcode:myguest
accept-version:1.1,1.0
heart-beat:10000,10000
<<< CONNECTED
version:1.1
session:-109518014
server:ActiveMQ-Artemis/1.1.0.wildfly-017 ActiveMQ Artemis Messaging Engine
heart-beat:10000,10000
connected to server ActiveMQ-Artemis/1.1.0.wildfly-017 ActiveMQ Artemis Messaging Engine
Connected: CONNECTED
heart-beat:10000,10000
server:ActiveMQ-Artemis/1.1.0.wildfly-017 ActiveMQ Artemis Messaging Engine
session:-109518014
version:1.1
>>> SUBSCRIBE
id:sub-0
destination:jms.topic.chat
<<< ERROR
message:AMQ339016\c Error creating subscription sub-0
content-type:text/plain
content-length:102
AMQ119032: User: myguest does not have permission='CREATE_NON_DURABLE_QUEUE' on address jms.topic.chat
我在控制台 Web 浏览器中收到此错误:
<<< ERROR
message:AMQ339016\c Error creating subscription sub-0
content-type:text/plain
content-length:102
AMQ119032: User: myguest does not have permission='CREATE_NON_DURABLE_QUEUE' on address jms.topic.chat
我不明白为什么忽略为“jms.topic.chat”模式配置的 create-non-durable-queue="true"标志。
我在互联网上没有找到有关 AMQ119032 错误的信息。以及 WildFly 10 管理 XML 配置的方式。
谢谢
最佳答案
我发现问题是什么,当您创建应用程序用户时,您需要添加用户拥有的组。问题在于“add-user.bat”脚本将其称为“组”,而在消息传递 ActiveMQ 中将其称为“Angular 色”。当“add-user.bat 询问组时,您是否希望该用户属于可写的组,例如“guest”。
您希望该用户属于哪些组? (请输入逗号分隔的列表,或者留空不填写)[ ]: guest
目前这对我有用。
What type of user do you wish to add?
a) Management User (mgmt-users.properties)
b) Application User (application-users.properties)
(a): b
Enter the details of the new user to add.
Using realm 'ApplicationRealm' as discovered from the existing property files.
Username : myguest2
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
- The password should be different from the username
- The password should not be one of the following restricted values {root, admin, administrator}
- The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
Password : myguest2
WFLYDM0098: The password should be different from the username
Are you sure you want to use the password entered yes/no? yes
Re-enter Password : myguest2
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[ ]: guest
About to add user 'myguest2' for realm 'ApplicationRealm'
Is this correct yes/no? yes
Added user 'myguest2' to file 'C:\WildFlyServer\wildfly-10.1.0.Final\standalone\configuration\applicationusers.properties'
Added user 'myguest2' to file 'C:\WildFlyServer\wildfly-10.1.0.Final\domain\configuration\application-users.properties'
Added user 'myguest2' with groups guest to file 'C:\WildFlyServer\wildfly-10.1.0.Final\standalone\configuration\application-roles.properties'
Added user 'myguest2' with groups guest to file 'C:\WildFlyServer\wildfly-10.1.0.Final\domain\configuration\application-roles.properties'
Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting conn
ection for server to server EJB calls.
yes/no? yes
To represent the user add the following to the server-identities definition <secret value="bXlndWVzdDI=" />
Presione una tecla para continuar . . .
关于javascript - 野蝇 10 AMQ119032 : User does not have permission CREATE_NON_DURABLE_QUEUE on address,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39134984/
我从 ssh 收到以下错误: Permissions 0777 for '/Users/username/.ssh/id_rsa' are too open. It is recommended th
我正在使用 WSL1(Windows Linux 子系统)和 Ubuntu 20.04.1 LTS 开发 Win10。我有一个 Samba (1.0) 网络共享,我想通过我的 Ubuntu 终端在上面
文件权限 我有一个文件 data.tgz我想解压缩。 -rw-r--r-- 1 username group 20342951248 mai 18 11:50 data.tgz 目录权限 文件所在的目
我正在尝试设置一些其他组不应该看到的组维护文件夹。目前,我通过取消单击@@sharing 选项卡中的“从更高级别继承权限”复选框来实现这一点,但我想自动执行此操作。 我在文档或谷歌搜索中找不到任何关于
在 Android 4 下,以下简单的 native C 代码行失败并出现 Permission denied 错误 when not run as 根: online_socket = socket
(我是 tortoise SVN 的新手) 我的乌龟 SVN 中有 2 个文件夹。每个人都需要一组不同的授权(我不想有权访问第一个文件夹的人对第二个文件夹具有读/写访问权限。 我怎样才能完成它?我注意
我用 tar -zxvf tarFile.tar.gz解压tarFile,但有错误提示tar: subfile :Cannot open: Permission denied . 我是root用户,权
我是 WAMP 的新手我今天刚刚安装了它。 设置进行得很顺利,本地主机似乎可以工作,但是当我尝试访问 phpMyAdmin 时我收到此错误: Forbidden You don't have perm
我想做的是从文件夹内的文件夹中获取 .mp3 文件。多次。 一切都很完美,除了当我尝试将文件复制到新文件夹(已经存在)时,它给出:[Errno 13]权限被拒绝: import os, shutil
我是 WAMP 的新手我今天刚刚安装了它。 设置进行得很顺利,本地主机似乎可以工作,但是当我尝试访问 phpMyAdmin 时我收到此错误: Forbidden You don't have perm
我正在开发一个应用程序,我在其中使用塔位置跟踪位置。所以我使用地理定位 api 来跟踪位置并访问手机状态以获取网络详细信息。 这很好用,突然间它开始给出 LOCATION_HARDWARE 权限的安全
这两种语法有什么区别。android:uses-permission 和 uses-permission。例如: 当我创建一个从存储中读取的 Activity 时,Android Studio 自
我正在尝试使用新的 GrantPermissionRule这是最新支持库的一部分。 在我的 list 中,我声明如下: 在我的代码中,我调用: @Rule public GrantPermissio
有没有navigator.permissions.query 的替代方案 Permissions API 查询以检查 geolocation 权限。导致它仍处于工作草案中并且浏览器兼容性较差。 W3C
这个错误真的真的很奇怪,我不知道如何重现它以及如何修复它,因为我进行了大量搜索,但没有任何用处。 这是堆栈跟踪: Stack Trace _______________________________
我正在尝试在 ubuntu 16.4 上安装 MaryTTS。 但是当我上线时 sudo -u mary git clone https://github.com/marytts/marytts.gi
在我们基于 Symfony2 的应用程序中,我们希望创建一个列表,列出系统中哪些用户对给定域对象具有权限。我们正在使用 ACL,我们的直接直觉是查看从相关域对象的 ACLProvider 返回的 AC
我今天收到这封邮件,但我没有使用 Admob 广告,而是使用 applovin 和 Facebook,我必须添加此权限还是仅适用于他们使用 Admob 的开发者? 即使没有像我一样的admob,每个人
我有一个 Jenkins 用户,我想授予其对 Jenkins 实例运行远程 CLI 的权限。第一个命令是获取 config.xml: java -jar jenkins-cli.jar -s http
我今天收到这封邮件,但我没有使用 Admob 广告,而是使用 applovin 和 Facebook,我必须添加此权限还是仅适用于他们使用 Admob 的开发者? 即使没有像我一样的admob,每个人
我是一名优秀的程序员,十分优秀!