Where do I find amqp_userinfo of amqp_URI for connecting to RabbitMQ - rabbitmq

So I'm trying connect to my local RabbitMQ server through a java application using the amqp_URI which is of the following format
amqp_URI = "amqp://" amqp_authority [ "/" vhost ] [ "?" query ]
amqp_authority = [ amqp_userinfo "#" ] host [ ":" port ]
amqp_userinfo = username [ ":" password ]
the question is where do I find the amqp_userinfo in my server for the connection.
the user: guest and pwd: guest of the http://localhost:15672/ doesn't work. I have also tried creating a new user in http://localhost:15672/ and using it, it doesn't help.
Thanks in advance

Got it, apparently the password length was too short, was successful when I created longer password for the user

Related

How to send reset password link to gmail of jetstream in laravel 9

I have a Laravel-9 site in Liver Server. I used Jetstream package for authentication. I want to reset my password through my Gmail. For this, I write these codes in
.env file:
MAIL_MAILER=smtp
MAIL_HOST=smtp.googlemail.com [also tried with smtp.gmail.com]
MAIL_PORT=465
MAIL_USERNAME=mygmail
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=ssl
MAIL_FROM_ADDRESS="mygmail"
MAIL_FROM_NAME="${APP_NAME}"
in config/mail.php
'stream'=>[
'ssl'=>[
'allow_self_signed'=>true,
'verify_peer'=>false,
'verify_peer_name'=>false,
],
],
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'mygmail'),
'name' => env('MAIL_FROM_NAME', 'mysubject'),
],
when I want to reset the password and enter the my gmail it shows:
Connection could not be established with host "ssl://smtp.googlemail.com:465": stream_socket_client(): Unable to connect to ssl://smtp.googlemail.com:465 (Network is unreachable)
How can I solve it and send the reset link to my Gmail?

auth_ldap.log is not appearing when auth_ldap.log = network in RabbitMQ

I've created a rabbitmq.conf and advanced.config for RabbitMQ intended to allow LDAP authentication with internal fallback. Because RabbitMQ is dumb and tries to use the installing user's appdata which is a terrible design for a Windows service, I've also redirected locations with environment variables:
RABBITMQ_BASE = D:\RabbitMQData\
RABBITMQ_CONFIG_FILE = D:\RabbitMQData\config\rabbitmq.conf
RABBITMQ_ADVANCED_CONFIG_FILE = D:\RabbitMQData\config\advanced.config
The config locations appear to be working correctly as they are referenced in the startup information and cause no errors on startup.
rabbitmq.conf (trimmed to relevant portions)
auth_backends.1 = ldap
auth_backends.2 = internal
auth_ldap.servers.1 = domain.local
auth_ldap.use_ssl = true
auth_ldap.port = 636
auth_ldap.dn_lookup_bind = as_user
auth_ldap.log = network
log.dir = D:\\RabbitMQData\\log
log.file.level = info
log.file.rotation.date = $D0
log.file.rotation.size = 10485760
advanced.config
[
{rabbitmq_auth_backend_ldap, [
{ssl_options, [{cacertfile,"D:\\RabbitMQData\\SSL\\ca.pem"},
{certfile,"D:\\RabbitMQData\\SSL\\server_certificate.pem"},
{keyfile,"D:\\RabbitMQData\\SSL\\server_key.pem"},
{verify, verify_peer},
{fail_if_no_peer_cert, true}
]},
{user_bind_pattern, ""},
{user_dn_pattern, ""},
{dn_lookup_attribute, "sAMAccountName"},
{dn_lookup_base, "DC=domain,DC=local"},
{group_lookup_base,"OU=Groups,DC=domain,DC=local"},
{vhost_access_query, {in_group, "cn=RabbitUsers,OU=Groups,DC=domain,DC=local"}},
{tag_queries, [
{administrator, {in_group, "CN=RabbitAdmins,OU=Groups,DC=domain,DC=local"}},
{management, {in_group, "CN=RabbitAdmins,OU=Groups,DC=domain,DC=local"}}
]}
]}
].
I'm using auth_ldap.log = network so there should be an ldap_auth.log file in my log directory which would help me troubleshoot but it's not there. Why would this occur? I've not seen any documented settings for auth_ldap logging other than .log so I would assume it would be with the other logs.
I'm currently running into issues with LDAP, specifically the error LDAP bind error: "xxxx" anonymous_auth. As I'm using simple bind via auth_ldap.dn_lookup_bind = as_user I should not be getting anonymous authentication. Without the detailed log however, I can't get additional information.
Okay looks I made two mistakes here:
Going back and re-reading, looks like I misinterpreted the documentation and believed auth_ldap.log was a separate file rather than just a setting. All the LDAP logging goes into the normal RabbitMQ log.
I had pulled Luke Bakken's config from https://groups.google.com/g/rabbitmq-users/c/Dby1OWQKLs8/discussion but the following lines ended up as:
{user_bind_pattern, ""},
{user_dn_pattern, ""}
instead of
    {user_bind_pattern, "${username}"},
    {user_dn_pattern, "${ad_user}"},
I had used a Powershell script with a herestring to create the config file which erroneously interpreted those variables as empty strings. Fixing that let me log on with "domain\username".

How to concatenate password with mysql:// protocol in Rebol?

I have a password that contains "]" so rebol doesn't accept mysql://user:password
How to concatenate a string with mysql:// ?
You can use the block form to open the port:
my-database: open [
scheme: 'mysql
host: "localhost"
user: "user"
pass: "pass"
path: "/dbpath"
]
You can examine output from the DECODE-URL function to see how Rebol turns a URL into a port specification:
probe decode-url foo://bar:baz#foobar.qux:999/quux

Fiware Orion context broker subscription notification issue

I'm using orion context broker GE image orion-psb-image-R5.4 version 1.7.0 and I registered a device entity in it , then i implemented in my raspberry pi simple python server script that listens to any incoming message and print it on the Pi's logs . then i sent a subscription message to the context broker to let my raspberry pi subscribe to its corresponding entity in the context broker. The issue is that whenever i update the condition attributes in the entity in the context broker , they're supposed to trigger a notification to the raspberry pi and then the server script in the PI print the notification in the Pi's logs . But what really happens is that the context broker may trigger the notification for several times and then suddenly stops sending any notification when any additional change is applied to the condition attribute , and on every attempt i make i retrieve the subscription status in the context broker and i find that there was a failure stated by the lastfailure attribute giving me the time of my last failed attempt.
I thought the problem could be the connection to my Pi or even in the server script itself but when i launched direct requests from my terminal to the raspberry pi , it prints the all messages immediately even when the update is made from a remote place . So i concluded that the problem is definitely with the context broker and the notification process of the subscription itself .
Here's the subscription request i made :
curl -v contextbrokeraddress:1026/v2/subscriptions -s -S --header "Fiware-Service: XYZ" --header "Fiware-ServicePath: /XYZ" --header 'Content-Type: application/json' \
-d #- <<EOF
{
"description": " Try",
"subject": {
"entities": [
{
"id": "Controller1",
"type": "Controller"
}
],
"condition": {
"attrs": [
"switch",
"datashow"
]
}
},
"notification": {
"http": {
"url": "http://raspberryPiaddress:8080"
},
"attrs": [
"switch",
"datashow"
]
},
"expires": "2040-01-01T14:00:00.00Z",
"throttling": 5
}
EOF
now when the switch attribute is updated with a different value , it may trigger the notification to the raspberry pi for the first time only but then fails on any following attempts.
this is the simple python script that listens to the incoming notifications and print it in its logs:
import socket
HOST, PORT = '', 8080
listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
listen_socket.bind((HOST, PORT))
listen_socket.listen(1)
while True:
print "listening on port 8080"
client_connection, client_address = listen_socket.accept()
print "notified"
request = client_connection.recv(1024)
print request
client_connection.close()
And this is how the notification from the context broker is printed on the Pi's logs in its successful times:
listening on port 8080
notified
POST / HTTP/1.1
User-Agent: orion/1.7.0 libcurl/7.19.7
Host: raspberryPiaddress:8080
fiware-service: XYZ
Fiware-ServicePath: /XYZ
X-Auth-Token: token
Accept: application/json
Content-length: 208
Content-type: application/json; charset=utf-8
Fiware-Correlator: f48ced60-1069-11e7-b743-fa163e7c4daf
Ngsiv2-AttrsFormat: normalized
{"subscriptionId":"58cd49191e9c000de6ea89c7","data":[{"id":"Controller1","type":"Controller","switch":{"type":"command","value":"OFF","metadata":{}},"datashow":{"type":"string","value":"OFF","metadata":{}}}]}
And when the notification is not received on any following updates on the entity , i check that it was failure by retrieving the subscription status which states that a failure happened in the context broker on sending the notification at the exact time of my attempt. This the status i retrieve to check that:
[
{
"description": " Try",
"expires": "2040-01-01T14:00:00.00Z",
"id": "58cd49191e9c000de6ea89c7",
"notification": {
"attrs": [
"switch",
"datashow"
],
"attrsFormat": "normalized",
"http": {
"url": "http://ahmadpi.ddns.net:8080"
},
**"lastFailure": "2017-03-24T08:22:23.00Z",**
"lastNotification": "2017-03-24T08:22:18.00Z",
"lastSuccess": "2017-03-23T22:09:33.00Z",
"timesSent": 66
},
"status": "failed",
"subject": {
"condition": {
"attrs": [
"switch",
"datashow"
]
},
"entities": [
{
"id": "Controller1",
"type": "Controller"
}
]
},
"throttling": 5
}
]
the problem now seems to be relating to the context broker and the way the subscription/notification processes are handled inside it . Now, i want to know whether the problem regards the context broker image version that i used or whether it regards something else . I just want to know where's the problem and how it can be handled please and thanks so much.
Although I'm not fully sure as don't have all the inputs (specially, CB log traces), by "it worked well as I said but sometimes stops for some reasons" (see comments thread in the question post) I tend to think is some networking/connectivity problem, not directly related with Orion Context Broker.

Worklight Adapter to connect to Advantage Database

I need to connect to the Advantage Database through worklight Adapter.
I added the adsjdbc.jar(8.1), and added the datasource definition in *SQLadapter.xml file
<dataSourceDefinition>
<driverClass>com.extendedsystems.jdbc.advantage.ADSDriver</driverClass>
<url>jdbc:extendedsystems:advantage://ipaddress:port/wxzy$/TP8/COMPANY/ABCDMAIN/ABCDMAIN.add;</url>
<user>xyz</user>
<password>12345</password>
</dataSourceDefinition>
When I try to Invoke the procedure, It throws
{
"errors": [
"Runtime: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory ([Extended Systems][Advantage JDBC]Connection reset)"
],
"info": [
],
"isSuccessful": false,
"warnings": [
]
}
Kindly advice.
Thanks
Thanks #Idan,
I tried with a Java Program to connect, before trying with the adapter as below,
Class.forName("com.extendedsystems.jdbc.advantage.ADSDriver");
connection = DriverManager.getConnection("jdbc:extendedsystems:" +
"advantage://port:host//abcd$//TP8//COMPANY//XYZMAIN//XYZMAIN.add;user=xxxx;password=123456");
statement = connection.createStatement();
resultSet = statement.executeQuery("select * from USERS");
while (resultSet.next()) {
System.out.println("PS USER NAME :"+ resultSet.getInt("PS_USERNAME"));
}
But I get a com.extendedsystems.jdbc.advantage.ADSException: [Extended Systems][Advantage JDBC]Connection reset
Please Advice.
Thanks
I suspect that problem is in the JDBC URL value.
You have set the following:
<url>jdbc:extendedsystems:advantage://ipaddress:port/wxzy$/TP8/COMPANY/ABCDMAIN/ABCDMAIN.add;</url>
But in the documentation it gives this example:
("jdbc:extendedsystems:advantage://server1:6262/test/data;user=user1;password=up1");
So if I were you I'd check why you used the JBDC URL that you've used there, which does not seem to be inline with the product doucmentation of Advantage Database.