Git Product home page Git Product logo

jboss-jdg-quickstarts's Introduction

Build Status

Red Hat Data Grid Quickstarts

Red Hat Data Grid (RHDG) is an elastically scalable in-memory data store built on the open source Infinispan project.

RHDG Modes

You can use Red Hat Data Grid in two modes:

  • Library Mode provides binaries to build and deploy custom runtime environments. RHDG runs alongside your application in the same JVM. Your application has local access to a single node in a distributed cluster.

  • Remote Client-Server Mode provides a self-contained process in a container based on JBoss EAP. RHDG runs remotely and provides access to data through Hot Rod, REST, or Memcached interfaces.

About the Quickstarts

These quickstarts demonstrate Red Hat Data Grid features and capabilities with specific, working examples that you can reference in your own projects.

If you are using Remote Client-Server Mode, you should start with the helloworld-jdg quickstart to ensure that your server configuration is valid and you can start it successfully.

Quickstarts have Beginner, Intermediate, and Advanced levels. You should start with a level that is comfortable for you and move on to the next level as you gain expertise.

Some quickstarts are prerequisites for others that expand on certain capabilities or functionality. You should always deploy and run any prerequisite quickstarts first.

Available Quickstarts

This distribution contains the following quickstarts:

Quickstart Name Demonstrated Technologies Shows you how to...
carmart Data Grid, CDI Use Data Grid instead of a relational database.
carmart-tx Data Grid, CDI, Transactions Use Data Grid instead of a relational database with transactions enabled.
eap-cluster-app Data Grid, CDI, EJB Access an Data Grid cache from a JBoss EAP application using JDG modules for EAP.
helloworld-jdg Data Grid, CDI Use Data Grid in clustered mode with expiration.
hotrod-endpoint Data Grid, Hot Rod Access Data Grid remotely through the Hot Rod protocol.
hotrod-secured Data Grid, Hot Rod Securely access Data Grid remotely through the Hot Rod protocol.
memcached-endpoint Data Grid, Memcached Access Data Grid remotely through the Memcached protocol.
openshift Data Grid, OpenShift Complete tutorials for Data Grid on OpenShift that range from simple "Hello World" demonstrations to more advanced use cases.
rapid-stock-market Data Grid, Hot Rod, REST Use compatibility mode to access data with multiple protocols.
spring 4 Data Grid, Spring Use Spring 4 integration modules.
spring 5 Data Grid, Spring Use Spring 5 integration modules.
spring 4 session Data Grid, Spring Boot, Spring Session Use of Spring Boot and Spring Session with RHDG.
spring 5 session Data Grid, Spring Boot, Spring Session Use of Spring Boot and Spring Session with RHDG.
remote-query Data Grid, Hot Rod, Remote Query Query Data Grid remotely through the Hot Rod protocol.
rest-endpoint Data Grid, REST Access Data Grid remotely through the REST protocol.
secure-embedded-cache Data Grid, CDI, REST Secure Data Grid in Library (embedded) mode.
cdi Data Grid, CDI Use Data Grid CDI and JCache extensions.
camel-jbossdatagrid-fuse Camel, Data Grid, REST Use the Camel component camel-jbossdatagrid in JBoss Fuse.
spark Data Grid, Apache Spark Read and write data to Data Grid and use streaming to react to data changes in real time.

System Requirements

You need the following to build and run the quickstarts:

You can also run the quickstarts with JBoss Developer Studio or Eclipse.

Configuring Maven

If you have not yet done so, you must Configure Maven.

If you do not configure Maven, you must pass settings with every Maven command as follows: -s QUICKSTART_HOME/settings.xml

Setting Environment Variables

RHDG quickstarts use the following environment variables:

  • JBOSS_HOME denotes the path to your RHDG server installation.
  • EAP_HOME denotes the path to your JBoss EAP installation.

EAP_HOME is a replaceable value. When you encounter it in a RHDG quickstart, change the value as appropriate.

Installation method Installation directory
ZIP archive Custom directory
RPM /var/lib/jbossas/
Installer {USER_HOME}/EAP-6.3.0
JBoss Developer Studio installer {USER_HOME}/jbdevstudio/runtimes/jboss-eap

Where {USER_HOME} is one of the following:

  • Linux: /home/USER_NAME/
  • Windows: "C:\Users\USER_NAME\"

Running the Quickstarts

Refer to the README file in each quickstart directory for instructions on building and running the quickstart.

Building Quickstart Archives

You can build archives without deploying the quickstarts to check for compilation errors and view the contents of the quickstart.

From the root directory of the quickstart, run $ mvn clean install to build the archive.

Contributing the Quickstarts

Refer to JBoss Developer Contributing Guide

jboss-jdg-quickstarts's People

Contributors

alanfx avatar alvarolop avatar andyuk1986 avatar anistor avatar danberindei avatar diegolovison avatar erlyfall avatar galderz avatar gbabcan avatar gustavolira avatar jsenko avatar karesti avatar mgencur avatar michalszynkiewicz avatar nak3 avatar nekop avatar oranod avatar pruivo avatar pzapataf avatar rafabene avatar rigazilla avatar ryanemerson avatar sgilda avatar slaskawi avatar tristantarrant avatar tsykora avatar vaclavdedik avatar vchintal avatar vjuranek avatar wfink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jboss-jdg-quickstarts's Issues

Indexing configuration not suitable for cluster

The remote query quickstart should be updated so that it's easy to run the sample in a cluster. The suggested configuration is using local-caches, plus "ram" indexing that will not work when more than a server is involved.

"jboss-remote-query-quickstart" not working

Hi ,

I am running "jboss-remote-query-quickstart" from STS in debug mode.
After line no 92, i.e remoteCache = cacheManager.getCache(cacheName); , the debug pointer is not moving . and Application hangs and throws following exception.

Please help on this.

ERROR RetryOnFailureOperation ISPN004007: Exception encountered. Retry 10 out of 10
org.infinispan.client.hotrod.exceptions.TransportException:: Could not fetch transport
at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory.borrowTransportFromPool(TcpTransportFactory.java:395)
at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory.getTransport(TcpTransportFactory.java:241)
at org.infinispan.client.hotrod.impl.operations.FaultTolerantPingOperation.getTransport(FaultTolerantPingOperation.java:26)
at org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation.execute(RetryOnFailureOperation.java:53)
at org.infinispan.client.hotrod.impl.RemoteCacheImpl.ping(RemoteCacheImpl.java:490)
at org.infinispan.client.hotrod.impl.RemoteCacheImpl.resolveCompatibility(RemoteCacheImpl.java:551)
at org.infinispan.client.hotrod.RemoteCacheManager.createRemoteCache(RemoteCacheManager.java:273)
at org.infinispan.client.hotrod.RemoteCacheManager.getCache(RemoteCacheManager.java:165)
at org.infinispan.client.hotrod.RemoteCacheManager.getCache(RemoteCacheManager.java:160)
at org.jboss.as.quickstarts.datagrid.hotrod.query.SnowForecast.(SnowForecast.java:92)
at org.jboss.as.quickstarts.datagrid.hotrod.query.SnowForecast.main(SnowForecast.java:232)
Caused by: org.infinispan.client.hotrod.exceptions.TransportException:: Could not connect to server: /127.0.0.1:11222
at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransport.(TcpTransport.java:78)
at org.infinispan.client.hotrod.impl.transport.tcp.TransportObjectFactory.makeObject(TransportObjectFactory.java:35)
at org.infinispan.client.hotrod.impl.transport.tcp.TransportObjectFactory.makeObject(TransportObjectFactory.java:16)
at infinispan.org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220)
at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory.borrowTransportFromPool(TcpTransportFactory.java:390)
... 10 more
Caused by: java.net.ConnectException: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:111)
at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransport.(TcpTransport.java:68)
... 14 more
Exception in thread "main" org.infinispan.client.hotrod.exceptions.TransportException:: Could not fetch transport
at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory.borrowTransportFromPool(TcpTransportFactory.java:395)
at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory.getTransport(TcpTransportFactory.java:241)
at org.infinispan.client.hotrod.impl.operations.FaultTolerantPingOperation.getTransport(FaultTolerantPingOperation.java:26)
at org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation.execute(RetryOnFailureOperation.java:53)
at org.infinispan.client.hotrod.impl.RemoteCacheImpl.ping(RemoteCacheImpl.java:490)
at org.infinispan.client.hotrod.impl.RemoteCacheImpl.resolveCompatibility(RemoteCacheImpl.java:551)
at org.infinispan.client.hotrod.RemoteCacheManager.createRemoteCache(RemoteCacheManager.java:273)
at org.infinispan.client.hotrod.RemoteCacheManager.getCache(RemoteCacheManager.java:165)
at org.infinispan.client.hotrod.RemoteCacheManager.getCache(RemoteCacheManager.java:160)
at org.jboss.as.quickstarts.datagrid.hotrod.query.SnowForecast.(SnowForecast.java:92)
at org.jboss.as.quickstarts.datagrid.hotrod.query.SnowForecast.main(SnowForecast.java:232)
Caused by: org.infinispan.client.hotrod.exceptions.TransportException:: Could not connect to server: /127.0.0.1:11222
at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransport.(TcpTransport.java:78)
at org.infinispan.client.hotrod.impl.transport.tcp.TransportObjectFactory.makeObject(TransportObjectFactory.java:35)
at org.infinispan.client.hotrod.impl.transport.tcp.TransportObjectFactory.makeObject(TransportObjectFactory.java:16)
at infinispan.org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220)
at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory.borrowTransportFromPool(TcpTransportFactory.java:390)
... 10 more
Caused by: java.net.ConnectException: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:111)
at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransport.(TcpTransport.java:68)
... 14 more

SnowForecast demo option 1 not working with Continous query listener

Hello all,

I am trying to run remote-query example using:
mvn exec:java -PSnowForecast

I have added

3
Continuous query listener added.

And then added a forecast:

1
Enter forecast id (int): 1
Enter location (string): 1
Enter year (int): 1
Enter month (int): 1
Enter day (int): 1
Rain (float): 0
Snowfall (float): 1
Temperature (float): 76
Humidity (float): 76

And then got an exception:

ERROR ClientListenerNotifier ISPN004038: Unexpected error consuming event ClientCacheEntryCustomEvent(eventData=[B@768c6c17, eventType=CLIENT_CACHE_ENTRY_MODIFIED)
org.infinispan.commons.CacheListenerException: ISPN004035: Caught exception [java.lang.reflect.InvocationTargetException] while invoking method [public void org.infinispan.client.hotrod.event.ContinuousQueryImpl$ClientEntryListener.handleEvent(org.infinispan.client.hotrod.event.ClientCacheEntryCustomEvent) throws java.io.IOException] on listener instance: org.infinispan.client.hotrod.event.ContinuousQueryImpl$ClientEntryListener@13adaec2
at org.infinispan.client.hotrod.event.ClientListenerNotifier$ClientListenerInvocation.invoke(ClientListenerNotifier.java:351)
at org.infinispan.client.hotrod.event.ClientListenerNotifier$EventDispatcher.invokeCallbacks(ClientListenerNotifier.java:331)
at org.infinispan.client.hotrod.event.ClientListenerNotifier$EventDispatcher.invokeClientEvent(ClientListenerNotifier.java:316)
at org.infinispan.client.hotrod.event.ClientListenerNotifier$EventDispatcher.run(ClientListenerNotifier.java:263)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.infinispan.client.hotrod.event.ClientListenerNotifier.lambda$null$0(ClientListenerNotifier.java:78)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.infinispan.client.hotrod.event.ClientListenerNotifier$ClientListenerInvocation.invoke(ClientListenerNotifier.java:349)
... 9 more
Caused by: java.lang.IllegalStateException: Unexpected tag : 8
at org.infinispan.protostream.WrappedMessage.readMessage(WrappedMessage.java:174)
at org.infinispan.protostream.ProtobufUtil.fromWrappedByteArray(ProtobufUtil.java:103)
at org.infinispan.protostream.ProtobufUtil.fromWrappedByteArray(ProtobufUtil.java:98)
at org.infinispan.client.hotrod.event.ContinuousQueryImpl$ClientEntryListener.handleEvent(ContinuousQueryImpl.java:107)
... 14 more

Any idea why?

Thanks in advance,
Ângelo Costa

Forecast example error on infinispan-server startup

Hello all,

I have been working on the remote-query example and was trying to change from local cache to a distributed-cache so i changed the configuration to:

                <distributed-cache name="addressbook_indexed" owners="2" mode="ASYNC" segments="20" start="EAGER" remote-timeout="300000">

                    <!-- Define the locking isolation of this cache -->
                    <locking isolation="READ_UNCOMMITTED" striping="false" acquire-timeout="15000" concurrency-level="10000" />
                        
                    <!-- Enable indexing using the RAM Lucene directory provider -->
                    <indexing index="ALL">
                        <property name="default.indexBase">${jboss.server.name}/index</property>
                        <property name="default.indexmanager">near-real-time</property>
                        <property name="default.directory_provider">ram</property>
                    </indexing>
                    
                    <!-- Define the JdbcBinaryCacheStores to point to the ExampleDS previously defined -->
                    <string-keyed-jdbc-store datasource="java:jboss/datasources/DSMysql" passivation="false" preload="true" purge="false">

                        <!-- specifies information about database table/column names and data types -->
                        <string-keyed-table prefix="JDG">
                            <id-column name="id" type="VARCHAR(100)"/>
                            <data-column name="datum" type="BLOB"/>
                            <timestamp-column name="version" type="BIGINT"/>
                        </string-keyed-table>
                    </string-keyed-jdbc-store>
                </distributed-cache>
                <!-- End of 'addressbook_indexed' cache definition -->

Right now i am able to run the demo with:
mvn exec:java -PSnowForecast

and then add one forecast successfully and i see that forecast stored in the database. In my case it's a mysql database.

If i stop the infinispan-server and startup it again, i get an error:

Caused by: java.lang.IllegalArgumentException: Message descriptor not found : quickstart.Forecast
at org.infinispan.protostream.impl.SerializationContextImpl.getMessageDescriptor(SerializationContextImpl.java:180)
at org.infinispan.query.remote.impl.indexing.WrappedMessageTagHandler.onTag(WrappedMessageTagHandler.java:66)
at org.infinispan.protostream.ProtobufParser.parseMessage(ProtobufParser.java:76)

How can i solve this?

Thanks in advance,
Ângelo Costa

Trying to get quickstarts working with JBoss EAP 6.4

I get the following error....

Alberts-MacBook-Pro:helloworld-jdg alwong$ mvn -version
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T13:58:10-07:00)
Maven home: /usr/local/apache-maven-3.2.3
Java version: 1.8.0_45, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.2", arch: "x86_64", family: "mac"
Alberts-MacBook-Pro:helloworld-jdg alwong$ mvn clean package jboss-as:deploy
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project org.jboss.quickstarts.jdg:jboss-helloworld-jdg:6.6.0-redhat-SNAPSHOT (/Users/alwong/sandbox/jboss-jdg-quickstarts/helloworld-jdg/pom.xml) has 3 errors
[ERROR]     Non-resolvable import POM: Failure to find org.infinispan:infinispan-bom:pom:6.4.0.ER4-redhat-1 in http://maven.repository.redhat.com/earlyaccess/all/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss-earlyaccess-repository has elapsed or updates are forced @ line 57, column 25 -> [Help 2]
[ERROR]     'dependencies.dependency.version' for org.infinispan:infinispan-embedded:jar is missing. @ line 112, column 21
[ERROR]     'dependencies.dependency.version' for javax.cache:cache-api:jar is missing. @ line 125, column 21
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
Alberts-MacBook-Pro:helloworld-jdg alwong$

Which tag corresponds to the latest release?

We are updating the quickstart versions on developers.redhat.com, and wanted to make sure that we have the most current GA (or approved - we suspected 6.5.1.CR1) release available so that the quickstarts are in sync and we aren't leading people to unsupported versions on our site.

Improve spring-session to show that session replication

@slaskawi The spring-session module is excellent to show how HTTP sessions could be saved in Infinispan caches but we aren't actually showing the value by demo'ing the session replication if a new spring-boot instance comes up and we hit the same context path. We should be able to show that session replicated and the same session ID is displayed as was created in the first spring-boot container.

I have the code ready, let me know if a pull request can be sent. Thanks!

child modules mention com.ocpsoft:prettyfaces, but it's not used.

There is a rather old an unused (there is no pretty-config.xml, or annotations present) dependency bundled with this project. Please consider removing.

$ grep -inr ocpsoft *
carmart/pom.xml:29:        <com.ocpsoft.prettyfaces.version>3.3.2</com.ocpsoft.prettyfaces.version>
carmart/pom.xml:100:                <groupId>com.ocpsoft</groupId>
carmart/pom.xml:102:                <version>${com.ocpsoft.prettyfaces.version}</version>
carmart/pom.xml:170:            <groupId>com.ocpsoft</groupId>
carmart-tx/pom.xml:28:        <com.ocpsoft.prettyfaces.version>3.3.2</com.ocpsoft.prettyfaces.version>
carmart-tx/pom.xml:141:                <groupId>com.ocpsoft</groupId>
carmart-tx/pom.xml:143:                <version>${com.ocpsoft.prettyfaces.version}</version>
carmart-tx/pom.xml:224:            <groupId>com.ocpsoft</groupId>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.