[ 
https://issues.apache.org/jira/browse/AMQ-8451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17484380#comment-17484380
 ] 

Jean-Baptiste Onofré commented on AMQ-8451:
-------------------------------------------

When you send the message, do you set the upload URL ?

On ActiveMQ 5.16.x, we enforce (for security reason) the check of the message. 
It has been added in commit:
{code:java}
commit 45108a232843ec1b9d678d96af5b9d2ec57c5a04 (github/pr/517)
Author: Colm O hEigeartaigh <[email protected]>
Date:   Tue Mar 24 14:57:55 2020 +0000


    AMQ-7450 - Put some restrictions on the URLs that are allowed in 
BlobMessages {code}
Especially, we added:
{code:java}
 +        // Do some checks on the received URL against the transfer policy
+        URL uploadURL = new URL(super.transferPolicy.getUploadUrl());
+        String protocol = message.getURL().getProtocol();
+        if (!protocol.equals(uploadURL.getProtocol())) {
+            throw new IOException("The message URL protocol is incorrect");
+        }
+
+        String host = message.getURL().getHost();
+        if (!host.equals(uploadURL.getHost())) {
+            throw new IOException("The message URL host is incorrect");
+        }
+
+        int port = message.getURL().getPort();
+        if (uploadURL.getPort() != 0 && port != uploadURL.getPort()) {
+            throw new IOException("The message URL port is incorrect");
+        }{code}
So, in your case, you certainly not have set the host on the message URL, or 
different to what you sent.

I can add a flag to avoid such check but it make sense to have such check. So, 
can you please check the upload URL of the message you produce.

> Message URL Host is incorrect
> -----------------------------
>
>                 Key: AMQ-8451
>                 URL: https://issues.apache.org/jira/browse/AMQ-8451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.16.2
>            Reporter: Varun Ramachandran
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>             Fix For: 5.17.0, 5.16.4
>
>
> After I upgraded the Active MQ client version from 5.15.12 to 5.16.2 in our 
> pom.xml, I encounter the below exception for Blob Messages. I tried upgrading 
> to 5.16.3 and find the same problem
> *Exception*
> _java.io.IOException: The message URL host is incorrect_
>     _at 
> org.apache.activemq.blob.DefaultBlobDownloadStrategy.getInputStream(DefaultBlobDownloadStrategy.java:51)_
>     _at 
> org.apache.activemq.blob.BlobDownloader.getInputStream(BlobDownloader.java:38)_
>     _at 
> org.apache.activemq.command.ActiveMQBlobMessage.getInputStream(ActiveMQBlobMessage.java:132)_
>  
> The URL host of our message is same for both the versions, however it just 
> gives an exception for the 5.16.2 version.
> http://blob-service:8080/blob/ID
> ID Masked 
> Thanks in advance!
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to