Win a copy of Spark in Action this week in the Open Source Projects forum!

Walter Andresen

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

Recent posts by Walter Andresen

Can someone please help me understand how websocket protocol works.

I have a server which sends out notifications to multiple clients about some events using websockets. Events are sporadic, which means that it sends a notification only if something happens. Clients (javascript embedded into a web page) receive notifications and update a status bar that a user can see. Now, imagine a scenario, when a client subscribes to an event, and then goes offline. While the client is offline a new event is being sent to update a status. Then the client comes up online again. The question is, will it receive that event which was sent when it was offline to update the status to the correct one?

I guess, if the client doesn't receive messages being sent during offline period, I will need to implement "heartbeat" design pattern.  In this case I will be sending messages every 60 seconds by scheduler with the current status. In this case when a client goes back online it will receive a next heartbeat in 60 sec max to update the status.

Thank you.
I have to invoke JAX-RS webservice from the EAR application. The application already has a bunch of jars that it uses internally in the lib folder. Now, I need to add about 30 or 40 jars to invoke JAX-RS webservice into the same lib folder. The problem is that some of the jars are already exists in there with different versions.  For example, apache collections-commons, common-beans etc. What can I do to solve this?

PS: I use Appache CXF implementation of jax-rs

Thank you
3 years ago
I use JAX-RS and Spring.
4 years ago
Hi there!
I have a restful service that returns JSON. Is there anyway to generate a client jar and give it to clients who invokes it?
For example, when I use AWS, they provide a client jar, so you don't need to contruct JSON manually, you just invoke API to save something to S3, for example.
I want to generate a similar client jar for my own web service. Just wanted to see if it is possible...

Thank you
4 years ago
I want to stay away from EJBs like sessions beans, etc.

Well, what I am looking for is some standard components I can use to add circut breaker and configuration server functionality similar to Spring Cloud but on Weblogic. The problem with Spring cloud is that it works as standalone components without App server.

I googled and found AKKA circuit breaker, but I am not sure if it has some console to monitor?

Also I want to have some configuration data hosted somewhere, and when it changes my microservice will get notified about changes. It is implemented in Spring Cloud as Spring Configuration server, but overall it looks like a kind of intelligent cache functionality
4 years ago
I want to implement Micorservices using Weblogic. It looks like I cannot use Spring Cloud components because they work without app server. Is there anything similar to Hystrix in Spring Cloud that I can use with Weblogic container to implement Circuit-breaker pattern and have a monitoring dashboard embedded into my app (similar to Hystrix)?

Also is there anything similar to Spring Cloud Configuration Server for Weblogic? a kind of cache that notifies clients about changes

Thank you
4 years ago
I need to implement asynchronous processing in the web application. When a user logs in, I need to do some time consuming actions, sync it with another system, save some audit
info, etc, etc.

What I can do is to create a separate thread and execute some code, without waiting for a response. Or I can also use JMS.

So, I think I have 3 options:
1. use Java Executor framework and spawn a new thread
2. use Work Manage since this is weblogic app and schedules work for execution on a container-managed thread
3. use JMS, e.g. send a message to a queue and implement a listener that will execute the code asynchronously.

Any recommendation which approach is better and why?
I want to write an app that streams a live channel e.g. BBC or NBC. Does anyone know how to do this? When a user launch the app he will be able to watch those channels. Any ideas how to do this?

Thank you
4 years ago
That's weird. I do like paper and a lot of people do. Paper magazines feel good in your hands. The problem is that nobody tried to created a popular magazine about Java.

By the way, look at Bloomberg business week - this is a super popular magazine. A lot of people read it in the building where I live - I see it every day in the mail room.
4 years ago
Just curious why nobody likes to read well printed paper magazine about Java? I think it is so cool to have a real printed magazine with colorful pictures...
4 years ago
Hi there!
Does anybody know if there is any magazine about Java in Print? Just curious if something like this exists? I know there is Oracle Java Magazine, but it is only online..


Thanks
4 years ago
Hi there!

I need to do a bottleneck analysis/research to see where there might be performance issues now and in the future, when more users are registered in the system.
This is a pretty complex weblogic application with Spring, UI in Struts/JQuery,etc, Oracle, webserices, etc. The system has about 100 DB tables and a lot of business logic is written as stored procs. Does anybody recommend me how to start with this?

Thank you



4 years ago
I am thinking, should I post it as a open source project? or maybe publish on kick starter?
I have an idea... it maybe a business idea or an idea of an open source project.

so, the idea is to create series of posters on popular programming technologies. For example, poster #1: java, poster#2: J2EE, poster # 3: Spring, etc.

Each poster will consist of 9 pages with colorful diagrams and tables. So you can hang it on a wall in your office or at home. There might be UML diagrams or some charts diagrams in different colors to make look attractive. You can use it as a reference card or to prepare for an exam or an interview.

There are some reference/cheat sheets cards but they are so boring and unattractive. You cannot find and buy a colorful, professionally done poster on Java or Spring... I did google and checked amazon and dint find anything like this.


What do you think?





Craig Walls wrote:The best way to avoid anyone messing with the properties of a singleton bean like that is to (1) make them final and (2) not provide setter methods for them. Ideally, provide the values via constructor args and not by setters.

That said, I recognize there are cases where you need setter methods for non-final properties. In that case, it may be best to only inject those objects as an interface type that doesn't offer setter methods. Without those setter methods, it'd be difficult (not impossible) to change the values.

In the end, however, if members of the team are hell-bent on changing values that shouldn't be changed, the best way of dealing with it is with code review and frank discussion about why changing them is wrong. In short, although there are technical remedies, the real problem is a people problem, not a technical problem.



does it mean that the bean must tread safe? I am a bit confused. Thread safe means that multiple threads can access the bean at the same time and don't corrupt the data. But what if thread#1 changes varUser and then in 2 seconds thread#2 changes varUserJobTitle in the way that varUser and varUserJobTitle are not consistent. So we will have varUser=JamesBond and varJobTitle=ConstractionWorker. While all the methods are declared as synchronized.

4 years ago