Jack Tauson

Ranch Hand
+ Follow
since Mar 27, 2014
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jack Tauson

I have a question regarding how to track the status of the database request.

Brief Overview of what's going to happen:

1. User hits a submit button from the UI with some ids selected from the dropdown list.

2. A stored procedure is called by the webservice.  Web service updates a column(REQUEST_STATUS) in the database table REQUEST with REQUEST_STATUS =  NOT_YET_STARTED

3. Stored procedure starts working on the request and updates the REQUEST_STATUS column with REQUEST_STATUS=  IN PROGRESS

4. When the stored procedure finishes the request, it updates the REQUEST_STATUS column with REQUEST_STATUS = COMPLETE.

I want to know if I can implement a Java process, which can constantly keep looking for the REQUEST_STATUS column of the table using some identifier maybe and once it sees as COMPLETE, I want to send an email to the user from the Java process.


In the past, I have done simething similar with ActiveMQ , where my java process was looking for the status of the request using Spring JMS listner. However, in the above scenario, I am not planning to use ActiveMQ and hence wondering how to handle this scenario.
2 months ago
I have the following Java process which is listening to MyMessageQueue queue of ActiveMQ.And I can see the message getting retrieved using this statement  inside
processBrokerQueues method.



 
 I am wondering, if I want to listen to 20-30 different queues, Is it the correct way to add multiple  @JmsListener(destination = "MyMessageQueue") with different queue names like MessageQueue1, MessageQueue2 ....... so on and so forth until MessageQueue30?
2 months ago
I just have to deploy HTML,CSS and Javascript on the tomcat on RHEL server. So I want to create a WAR file.

I have Eclipse and wondering if I should create a Dynamic Web project and put all the static file contents inside WEB-INF directory? In this case, would I be able to create a WAR locally and deploy it on the Eclipse Tomcat? Would it show up in the Add / Remove options?


OR

Should I create a maven project and then put static contents?
2 months ago
I am planning to have a table in react - most likely data table which will have something like this.

Is this confirmed?Type your comments belowAction
Select Yes or No from dropdown list//Your comments goes hereAttach File



So I am planning to use material UI dropdown list component for the cell where it says Select Yes or No from dropdown list and textbox for the user to type their comments to the webservice behind upload.

That Attach File is a prime React FileUpload advanced component. So when I click on it and user hits the upload button , I want to pass the user's selection from first cell and their comments.

So I am planning to store Yes or No selection in session storage.

I am wondering, can I have their comments stored in session storage as well as they type?

Tim Holloway wrote:Also: http://portecle.sourceforge.net/

This tool really does make it easier to work with keys and keystores. Sorry I misspelled it. "portacle" is a LISP development system unrelated to Java or keystores. You want portecle with an "e", not an "a".



Thanks. I figured that it was a spelling mistake. So, in my context, what steps I should follow to avoid the error I am getting?
8 months ago

Tim Holloway wrote:Keytool operates on 2 password levels. One is for the keystore database itself and one is for the key entry. That's probably what's confusing you. Each key entry has its own password.

There's a GUI app called portacle that I have found invaluable for working with keystores. It not only allows you to do maintenance on keystores, you can also do imports, exports, and keytype conversions.

Incidentally, keystore databases are self-contained, so you can easily do offline maintenance and copy them to their proper home. Or create and destroy test keystores until you have what you want. I find this especially useful since my production servers don't run a GUI desktop, so I can use portacle locally and then copy the properly-configured keystore to its production home.



Thanks. I was thinking of the following :

To make my activemq_p_keystore.p12 file contain password as explained in the following documentation.

https://blog.jdriven.com/2015/10/keystore-without-a-password/

However, I am still confused what would would I enter when it asks for :

1) Enter destination keystore password:
and
2)Enter source keystore password:


8 months ago
I am trying to create a JKS file from existing private key and certificate and currently following the steps mentioned in this documentation ( http://xacmlinfo.org/2014/06/13/how-to-keystore-creating-jks-file-from-existing-private-key-and-certificate/).

I was able to generate PKCS12 file using the private key (which is `myrhelserver_cpy_dot_com.key `) and CA signed certificate (which is `CertificateBundle1.pem`) as shown below:


 

I pressed `Enter` key when it asked me to `Enter Export Password` and `Verifying – Enter Export Password`. After this I saw `activemq_p_keystore.p12` generated inside the directory as shown in the `ls` command below.


 

Here is my actual command :



It’s asking for so many passwords as you can see above. So I did the following:

For `Enter destination keystore password:` and `Re-enter new password:` I entered nothing and pressed `Enter` key. It then asked me for `Enter destination keystore password:` and then `Re-enter new password:` and `Enter source keystore password:`
“. I was lost after this.

What am I doing wrong here? Should I be creating new password at any of the steps above?


 
8 months ago

Paul Clapham wrote:For a start I would advise closing the connection in a finally-clause.



You mean something like the following at the following location:

 

// if there are any problems close the connection and it will be re-created next time
             if (connection != null) {
                 connection.close();
              }
              connection = null;
           }
        }
     } catch (Throwable th) {
        th.printStackTrace();
     }
    finally {
    if(connection != null) {
     connection.close();
    }
     }
  }

10 months ago
Brief Overview of my code:

I have the following Java process which is listening to MyMessageQueue queue of ActiveMQ.
As soon as it gets the message in the format userName#employeeID#companyID#projectID#clientTitle , I am extracting and using in my code below.

The code keeps on sending message in the format userName#employeeID#companyID#projectID#clientTitle back to ActiveMQ until it sees
if (receivedStatus.equals("COMPLETE")) { and sends out an email.

The problem I am facing is that after the whole process(which sometime could take few mins or 30 mins) is finished I am seeing open inactive connections. Basically my DBA is complaining about connections which are not closed. The connection count is
increasing after each use of this process. Any idea what's wrong with the connections in my code below?





 

10 months ago

Tim Holloway wrote:Red Hat has always been concerned with security, so unless you explicitly opened that port on the ActiveMQ machine's firewall, it will be blocked. Looks like you did an nmap and that's what it said, in fact.

The netstat command can be run on the server machine itself to determine if the port is open.



So based on the configurations related changes I did, I am correctly using port 8162 in the URL over https, right?

https://myserver.com:8162/admin/index.jsp

I will ask network team to open port 8162 then.
11 months ago

Tim Holloway wrote:Ah. I see. And yes, it does appear we have a hole in our forum offerings. I think I'll ask the Jedi Council about that.

Yeah, ActiveMQ has and embedded jetty webserver for its console. It makes sense now.

Anyway, have you checked this out: https://activemq.apache.org/web-console ? It seems straightforward. And I see that apparently jetty is now Spring-configured.

A note, however. Unless you are in a really paranoid shop. the ActiveMQ console should not really require SSL because it shouldn't be accessible outside of a very limited sublan or VLAN. One used only by system services and administrators. And if you are generous enough to allow access to the wider world, you might consider using a reverse proxy such as nginx, which is a lot easier to set up for SSL.



Yeah, I made my changes from there only. That page  has the following instructions which I followed.

webpage


It's not very clear to me if after making changes, I should be trying to access the web console like this https://myserver.com:8162/admin/index.jsp ?

I checked using PortQuery tool the status of the port 8162 and got the following:



So I am wondering if the port 8162 is not open on RHEL server so that my local machine could access that?
11 months ago

Tim Holloway wrote:Tomcat and jetty are two completely different webapp server products from two completely different suppliers. Tomcat has no idea of what to do with a "jetty.xml".

Aside from that, your "jetty.xml" looks a lot like a Spring Framework applicationContext.xml file.

So you might want to go back and make sure that your overall setup is correct.



Yeah, I couldn't find anything related to ActiveMQ on this forum and hence posted in Tomcat forum.

"jetty.xml" comes with activemq.

Not sure what part I am missing as I did exactly what the documentation has mentioned.
11 months ago
I have a RHEL 7 server where I have ActiveMQ installed (version : apache-activemq-5.15.11).I am trying to run the web console over https and hence I went through the instructions mentioned in the documentation here(https://activemq.apache.org/web-console.html) and made changes in my jetty.xml and un-commented the following section:

                   

when I am trying to access the web console like the following:

https://myserver.com:8162/admin/index.jsp

I am getting connection getting timed out in the browser.

Questions :


1) Am I trying to access it properly - via port 8162? It works fine with port 8161 and over http like the following:

http://myserver.com:8161/admin/index.jsp

2) Are there any additional changes needed to make it work over https?

My jetty.xml is below for reference:


 



 
11 months ago

Stephan van Hulst wrote:I'm pretty sure that Postman has some kind of control where you can enter request parameters and if the request is a GET request, Postman will encode the parameters in the URL for you. You shouldn't put parameters in the URL manually.

However, it appears that you are performing a request that modifies your application state. You must not use a GET request for this, but instead a POST or PUT request. The data that you want to store in the database should not be part of the URL, but rather of the request body.



Thank you.

The data that you want to store in the database should not be part of the URL, but rather of the request body.


I was thinking about this. I would appreciate if I could get some more advise on this.

While calling the download endpoint, I am calling the stored procedure in my code and that needs parameters and hence I decided to use it like GET request. I mean, the data which is the part of the URL is not directly getting saved into the database. Could you tell me if this scenario is still good or do I still need to consider sending the data as a part of request body? Thanks again !
1 year ago

Paul Clapham wrote:

Jack Tauson wrote:Should I do it like this (encode \ as %5C):

%5CABC10PCS_2015AA%5C



Well, yes and no. You should just be URL-encoding all of the parameter values of your URL, is what you should be doing. Not asking whether specific characters should be encoded.



I believe when you say "URL-encoding of all of the parameter values", you mean I should do it at the time of calling the end point from UI? OR is there a way to do it in POSTMAN client as well? Thanks !
1 year ago