Categories
Mastering Development

Invoke Java Lambda from SDK that accepts SQSEvent

I have a Lambda written in Java with this handler signature: public class MessageListenerHandler implements RequestHandler<SQSEvent, Map<String, Object>> { public Map<String, Object> handleRequest(SQSEvent event, Context context) { // Implementation here } } Normally this Lambda is triggered by an SQS message sent to a queue. I want to be able to invoke this Lambda from […]

Categories
Mastering Development

Vue PWA workboxOptions exclude folder structure

I have the following vue.config.js (showing just the relevant part) pwa: { workboxPluginMode: ‘InjectManifest’, workboxOptions: { swSrc: ‘src/plugins/service-worker/service-worker.js’, exclude: [/.*images\/(?!cached).*/g, /\.map$/, /manifest\.json$/] } }, I’m looking to exclude all ./src/assets/images/* images unless they are in the following directory: ./src/assets/images/cached/* Here is an example of this regex working: https://regex101.com/r/vANnrn/1/ However webpack/workbox still includes all of my […]

Categories
Mastering Development

Problems with Jpa Spring Boot application

There are a lot of errors when i try to run it, i will upload photos, because there is a lot of code line and i can’t understand exactly what happend. I did it by one guide, but this guid is quate old, may bee i should change the jpa dependencies, or create my database […]

Categories
Mastering Development

getAsJsonArray(String) is undefined for the type JsonObject

Map<String, String> contactInfo = new HashMap<>(); String response = get_global_search_response_for_contacts_by_email(restClient,BaseUrl,BasicAutorization, email); if (response.contains(email)) { logger.info("A contact with the specified email address has been found. Removing it to continue the testing…") JsonObject jObject = convertStringToJsonObject(response); //adding values of keys in List from objects JsonArray jarray = jObject.getAsJsonArray("items"); for (int i = 0; i < jarray.size(); i++) […]

Categories
Mastering Development

Apache Beam with Schema Registry

I am writing a simple Apache Beam pipeline that should consume from a kafka topic and write the messages to a text file. Both my kafka brokers and the schema registry are TLS enabled. Please see the code that I am running public static void main(String[] args) throws Exception { System.setProperty(“javax.net.ssl.trustStore”, “<truststore_path>/truststore.jks”); System.setProperty(“javax.net.ssl.trustStorePassword”, “<truststore_password>”); Map<String, […]

Categories
Mastering Development

JPA Select query is taking more time – beyond 60 seconds

Currently we have 45 different tables in DB with 1000 records in each table. Number of parallel requests we get is 15 messages / seconds and each record in table may not exceed 100 KB. Our situation is that we select the list of tables one after the other with a common id that we […]

Categories
Mastering Development

How to Concatenate Strings & fetch data flutter

I have problem in api calling i getting a geolocation of current place,i am passing the latitude&longitude but i having a problem is i need to pass the latitude&longitude to certain format like this lat_11.3054724$75.8744252 so i can’t try to concatinate the $ sign along with it,Also i am not getting any data when i […]

Categories
Mastering Development

Random ImageMagick error/”unexpected token” error on basic script that has neither

Right now, I am running a basic python script from bash that looks like this: import sys def main(): sys.stdout.write(“hi”) if __name__==”__main__”: main() When run using python (py justdosomething.py) it works fine. When I try to run it from bash, it gives this massive error message from imagemagick, despite me not importing it in this […]

Categories
Mastering Development

Spring MVC, Spring Security, and Tomcat: changed session ID and lost session data

The website I am supporting was developed with Spring MVC (4.2.9.RELEASE), Spring Security (3.2.5.RELEASE), JSP, and Hibernate (4.3.8.Final). The frontend is a load balancer (Kemp LoadMaster 3000) and the site runs on Tomcat (8.5.54). In order to find the cause of this issue, I am running only one Tomcat instance behind the load balancer in […]

Categories
Mastering Development

How Do I simplify this method

private Map<String, PortHist> calculateAccrual( List<TAReportingHoldingEnriched> reportingHoldings, Map<String, TAAsset> taAssets, BFMDate pricingDate) { Map<String, PortHist> map = new HashMap<>(); reportingHoldings.stream() // .collect(toMap( h-> h.getAssetCusip(), h->new PortHist(), (ph1, ph2)-> addamounts(ph1.getValue(), ph2.getValue()))); map = reportingHoldings.stream().collect(toMap(h -> h.getAssetCusip(), h-> // new PortHist(taAssets.get(h.getAssetCusip()).getPortfolioCode() , pricingDate.toJavaDate(), DATATYPE, h.getAccrual(), new Date(), DATASOURCE, null), (ph1, ph2) -> addamounts(ph1.getValue(), ph2.getValue()))); /*reportingHoldings.forEach(holding -> { if […]