Skip to content

Instantly share code, notes, and snippets.

@AdamBien
Created August 14, 2020 05:47
Show Gist options
  • Save AdamBien/6fb9ae56e83d78d643343013fa1a304d to your computer and use it in GitHub Desktop.
Save AdamBien/6fb9ae56e83d78d643343013fa1a304d to your computer and use it in GitHub Desktop.
78thAirhacksQ&A.md

Ask questions and see you at September, 7th, 8.PM. CET: https://vimeo.com/event/154379

Also checkout recent episode:

77 airhacks.tv

Please keep the questions Jakarta EE-stic. Means: as short and as concise as only possible. Feel free to ask several, shorter questions. Upcoming airhacks.tv events are also going to be announced at meetup.com/airhacks

@thehpi
Copy link

thehpi commented Sep 7, 2020

Payara (Grizzly) does not allow a backslash in a url. So a rest call with an {id} which contains a backslash never reaches the rest endpoint.
What is sent in the request is something that was returned earlier from another endpoint. I can add interceptors that will replace the (outgoing) backslash with something else and when it comes back in replace it back to the original value.

Is there a better way?

@FlorinAlexandru
Copy link

Hello Adam,

I have a class MyDao with an injected DataSource member: @Inject @Postgres private DataSource dataSource;. I have the @Postgres qualifier defined. To inject I'm using a producer method:

public class PostgresDataSourceProducer {
    @Resource(mappedName = "java:jboss/PostgresDS")
    private DataSource ds;

    @Produces
    @Postgres
    DataSource postgresDataSouce() {
        return ds;
    }
}

I want to do some integration tests for MyDao class. For this I need to change the datasource to point to my test database. How to do that?

Thank you,
Florin

@thehpi
Copy link

thehpi commented Sep 7, 2020

How would you handle concurrency if you create an MBean which has concurrently updated maps which of course are also read through JMX? @stateless would do it I guess but that feels like overkill. ConcurrentHashMaps? But what if the MBean also does small calculations?

@deratzmann
Copy link

deratzmann commented Sep 7, 2020

Hi Adam.

In one of the last episodes you mentioned, that replacing EJBs in quarkus Projects with CDI could be quite simple.

I created 2 Annotation Types.

For replacing @Stateless I would do sth. like this:

@Asynchronous
@Bulkhead
@RequestScoped
@Transactional
@Stereotype
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface StatelessBoundary {
    
}

For @Singleton I created this:

@Bulkhead(value = 1, waitingTaskQueue = 10)
@Singleton
@Transactional
@Stereotype
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface SingletonBoundary {
    
}

Is this a good way to replace my good old Stateless and Singleton Beans especially when using Bean Pooling (Stateless) and Single-Running-Process-at-one-time (Singleton)? Would you add sth other?

Best regards from Hamburg.

Bastian

@tmsanchez
Copy link

HI Adam,
what's your opinion about recent changes announced for MDN? https://hacks.mozilla.org/2020/08/an-update-on-mdn-web-docs/

@t-shaguy
Copy link

t-shaguy commented Sep 7, 2020

How is ORM ( foreign keys) handled in hibernate panache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment